diff --git a/bsp/raspberry-pi/raspi2/driver/bcm283x.h b/bsp/raspberry-pi/raspi2/driver/bcm283x.h index 85422e2a22..8339133652 100644 --- a/bsp/raspberry-pi/raspi2/driver/bcm283x.h +++ b/bsp/raspberry-pi/raspi2/driver/bcm283x.h @@ -3,8 +3,8 @@ #include -#define PER_BASE (0x3F000000) -#define PER_BASE_40000000 (0x40000000) +#define PER_BASE (0x3F000000) +#define PER_BASE_40000000 (0x40000000) /* * GPIO @@ -50,17 +50,17 @@ /* * ARM Timer */ -#define ARM_TIMER_BASE (PER_BASE + 0xB000) +#define ARM_TIMER_BASE (PER_BASE + 0xB000) -#define ARM_TIMER_LOAD HWREG32(ARM_TIMER_BASE + 0x400) -#define ARM_TIMER_VALUE HWREG32(ARM_TIMER_BASE + 0x404) -#define ARM_TIMER_CTRL HWREG32(ARM_TIMER_BASE + 0x408) -#define ARM_TIMER_IRQCLR HWREG32(ARM_TIMER_BASE + 0x40C) -#define ARM_TIMER_RAWIRQ HWREG32(ARM_TIMER_BASE + 0x410) -#define ARM_TIMER_MASKIRQ HWREG32(ARM_TIMER_BASE + 0x414) -#define ARM_TIMER_RELOAD HWREG32(ARM_TIMER_BASE + 0x418) -#define ARM_TIMER_PREDIV HWREG32(ARM_TIMER_BASE + 0x41C) -#define ARM_TIMER_CNTR HWREG32(ARM_TIMER_BASE + 0x420) +#define ARM_TIMER_LOAD HWREG32(ARM_TIMER_BASE + 0x400) +#define ARM_TIMER_VALUE HWREG32(ARM_TIMER_BASE + 0x404) +#define ARM_TIMER_CTRL HWREG32(ARM_TIMER_BASE + 0x408) +#define ARM_TIMER_IRQCLR HWREG32(ARM_TIMER_BASE + 0x40C) +#define ARM_TIMER_RAWIRQ HWREG32(ARM_TIMER_BASE + 0x410) +#define ARM_TIMER_MASKIRQ HWREG32(ARM_TIMER_BASE + 0x414) +#define ARM_TIMER_RELOAD HWREG32(ARM_TIMER_BASE + 0x418) +#define ARM_TIMER_PREDIV HWREG32(ARM_TIMER_BASE + 0x41C) +#define ARM_TIMER_CNTR HWREG32(ARM_TIMER_BASE + 0x420) /* * Core Timer diff --git a/bsp/raspberry-pi/raspi3-32/applications/main.c b/bsp/raspberry-pi/raspi3-32/applications/main.c index cda0e0d711..de0fe56137 100644 --- a/bsp/raspberry-pi/raspi3-32/applications/main.c +++ b/bsp/raspberry-pi/raspi3-32/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/applications/mnt.c b/bsp/raspberry-pi/raspi3-32/applications/mnt.c index 88b714022c..44450fe9b6 100644 --- a/bsp/raspberry-pi/raspi3-32/applications/mnt.c +++ b/bsp/raspberry-pi/raspi3-32/applications/mnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/applications/test_device.c b/bsp/raspberry-pi/raspi3-32/applications/test_device.c index 7efb1cfb64..ec7e480212 100644 --- a/bsp/raspberry-pi/raspi3-32/applications/test_device.c +++ b/bsp/raspberry-pi/raspi3-32/applications/test_device.c @@ -1,6 +1,6 @@ /* * File : test_driver.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -50,7 +50,7 @@ void test_hdmi() int i=0; for (; i < 20; i++) colors[i] = COLOR_RED; rt_graphix_ops(hdmi) -> blit_line((char *)colors, 20, 20, 20); - + #endif } @@ -73,8 +73,8 @@ void test_cpusmp(void) { rt_kprintf("Hello Test SMP!\n"); #ifdef RT_USING_SMP - int i; - char test_name[RT_NAME_MAX]; + int i; + char test_name[RT_NAME_MAX]; for (i = 0; i < _CPUS_NR; i++) { rt_sprintf(test_name, "smp%d", i); @@ -162,17 +162,17 @@ void test_i2c(void) rt_kprintf("can't find %s device!\n", name); else { - read_regs(i2c_bus, 7, buf); - buf[0] = buf[0]&0x7F; //sec - buf[1] = buf[1]&0x7F; //min - buf[2] = buf[2]&0x3F; //hour - buf[3] = buf[3]&0x07; //week - buf[4] = buf[4]&0x3F; //day - buf[5] = buf[5]&0x1F; //mouth - //year/month/day - rt_kprintf("20%02x-%02x-%02x ",buf[6],buf[5],buf[4]); - //hour:minute/second - rt_kprintf("%02x:%02x:%02x \n",buf[2],buf[1],buf[0]); + read_regs(i2c_bus, 7, buf); + buf[0] = buf[0]&0x7F; //sec + buf[1] = buf[1]&0x7F; //min + buf[2] = buf[2]&0x3F; //hour + buf[3] = buf[3]&0x07; //week + buf[4] = buf[4]&0x3F; //day + buf[5] = buf[5]&0x1F; //mouth + //year/month/day + rt_kprintf("20%02x-%02x-%02x ",buf[6],buf[5],buf[4]); + //hour:minute/second + rt_kprintf("%02x:%02x:%02x \n",buf[2],buf[1],buf[0]); } #endif } diff --git a/bsp/raspberry-pi/raspi3-32/cpu/armv7.h b/bsp/raspberry-pi/raspi3-32/cpu/armv7.h index 859b0371b7..a992fdebd0 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/armv7.h +++ b/bsp/raspberry-pi/raspi3-32/cpu/armv7.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/cpu/cp15.h b/bsp/raspberry-pi/raspi3-32/cpu/cp15.h index 14b85b7e64..d8075c84df 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/cp15.h +++ b/bsp/raspberry-pi/raspi3-32/cpu/cp15.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -57,7 +57,7 @@ static inline void send_ipi_msg(int cpu, int ipi_vector) static inline void setup_bootstrap_addr(int cpu, int addr) { - CORE_MAILBOX3_SET(cpu) = addr; + CORE_MAILBOX3_SET(cpu) = addr; } static inline void enable_cpu_ipi_intr(int cpu) @@ -67,7 +67,7 @@ static inline void enable_cpu_ipi_intr(int cpu) static inline void enable_cpu_timer_intr(int cpu) { - CORETIMER_INTCTL(cpu) = 0x8; + CORETIMER_INTCTL(cpu) = 0x8; } static inline void enable_cntv(void) diff --git a/bsp/raspberry-pi/raspi3-32/cpu/cpu.c b/bsp/raspberry-pi/raspi3-32/cpu/cpu.c index 4d02ca35e1..b43b804597 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/cpu.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -52,7 +52,7 @@ void rt_hw_spin_lock(rt_hw_spinlock_t *lock) : "r" (&lock->slock), "I" (1 << 16) : "cc"); - while (lockval.tickets.next != lockval.tickets.owner) + while (lockval.tickets.next != lockval.tickets.owner) { __WFE(); lockval.tickets.owner = *(volatile unsigned short *)(&lock->tickets.owner); diff --git a/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c b/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c index c9e7c17f8f..11cfdb3d25 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,7 +7,7 @@ * Date Author Notes * 2018/5/3 Bernard first version * 2019-07-28 zdzn add smp support - * 2019-08-09 zhangjun fixup the problem of smp startup and scheduling issues, + * 2019-08-09 zhangjun fixup the problem of smp startup and scheduling issues, * write addr to mailbox3 to startup smp, and we use mailbox0 for ipi */ @@ -163,15 +163,15 @@ void rt_hw_ipi_send(int ipi_vector, unsigned int cpu_mask) } if (cpu_mask & 0x2) { - send_ipi_msg(1, ipi_vector); + send_ipi_msg(1, ipi_vector); } if (cpu_mask & 0x4) { - send_ipi_msg(2, ipi_vector); + send_ipi_msg(2, ipi_vector); } if (cpu_mask & 0x8) { - send_ipi_msg(3, ipi_vector); + send_ipi_msg(3, ipi_vector); } __DSB(); } diff --git a/bsp/raspberry-pi/raspi3-32/cpu/mmu.c b/bsp/raspberry-pi/raspi3-32/cpu/mmu.c index b3541d2ad4..f642dc235c 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/mmu.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/mmu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/cpu/mmu.h b/bsp/raspberry-pi/raspi3-32/cpu/mmu.h index 6b0c25e990..6b994cac77 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/mmu.h +++ b/bsp/raspberry-pi/raspi3-32/cpu/mmu.h @@ -43,7 +43,7 @@ /* normal memory mapping type */ #define NORMAL_MEM (SHARED | AP_RW | DOMAIN0 | MEMWBWA | DESC_SEC) #define STRONG_ORDER_MEM (SHARED | AP_RO | XN | DESC_SEC) -#define BUS_ADDRESS(phys) (((phys) & ~0xC0000000) | 0xC0000000) +#define BUS_ADDRESS(phys) (((phys) & ~0xC0000000) | 0xC0000000) void rt_hw_change_mmu_table(rt_uint32_t vaddrStart, rt_uint32_t size, diff --git a/bsp/raspberry-pi/raspi3-32/cpu/stack.c b/bsp/raspberry-pi/raspi3-32/cpu/stack.c index c2c60fbf49..4d20ad7879 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/stack.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/stack.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/cpu/trap.c b/bsp/raspberry-pi/raspi3-32/cpu/trap.c index f83f183695..b9fa6bb1c5 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/trap.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/trap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,7 +7,7 @@ * Date Author Notes * 2013-07-20 Bernard first version * 2019-07-28 zdzn add smp support - * 2019-08-09 zhangjun fixup the problem of smp startup and scheduling issues, + * 2019-08-09 zhangjun fixup the problem of smp startup and scheduling issues, * write addr to mailbox3 to startup smp, and we use mailbox0 for ipi */ @@ -164,7 +164,7 @@ void rt_hw_trap_irq(void) if (mailbox_data & 0x1) { /* clear mailbox */ - IPI_MAILBOX_CLEAR(cpu_id) = mailbox_data; + IPI_MAILBOX_CLEAR(cpu_id) = mailbox_data; isr_func = isr_table[IRQ_ARM_MAILBOX].handler; #ifdef RT_USING_INTERRUPT_INFO isr_table[IRQ_ARM_MAILBOX].counter++; @@ -175,7 +175,7 @@ void rt_hw_trap_irq(void) isr_func(IRQ_ARM_MAILBOX, param); } } - else + else CORE_MAILBOX3_CLEAR(cpu_id) = mailbox_data; } #endif diff --git a/bsp/raspberry-pi/raspi3-32/driver/board.c b/bsp/raspberry-pi/raspi3-32/driver/board.c index 9cd929662e..920d284c07 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/board.c +++ b/bsp/raspberry-pi/raspi3-32/driver/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/board.h b/bsp/raspberry-pi/raspi3-32/driver/board.h index 8736027c06..bc5be3f9c8 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/board.h +++ b/bsp/raspberry-pi/raspi3-32/driver/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_fb.c b/bsp/raspberry-pi/raspi3-32/driver/drv_fb.c index cc915351af..f004edad8c 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_fb.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_fb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -306,7 +306,7 @@ rt_err_t hdmi_fb_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -const static struct rt_device_ops hdmi_fb_ops = +const static struct rt_device_ops hdmi_fb_ops = { RT_NULL, hdmi_fb_open, @@ -368,7 +368,7 @@ static void hdmi_blit_line(const char* pixels, int x, int y, rt_size_t size) } } -static struct rt_device_graphic_ops hdmi_ops = +static struct rt_device_graphic_ops hdmi_ops = { hdmi_set_pixel, hdmi_get_pixel, diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_fb.h b/bsp/raspberry-pi/raspi3-32/driver/drv_fb.h index 4926fa3ab1..1d447aeab1 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_fb.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_fb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,15 +14,15 @@ #define COLOR_BLACK RGB(0, 0, 0) -#define COLOR_GREEN RGB(0, 255, 0) - -#define COLOR_CYAN RGB(0, 255, 255) +#define COLOR_GREEN RGB(0, 255, 0) -#define COLOR_RED RGB(255, 0, 0) +#define COLOR_CYAN RGB(0, 255, 255) -#define COLOR_YELLOW RGB(255, 255, 0) +#define COLOR_RED RGB(255, 0, 0) -#define COLOR_WHITE RGB(255, 255, 255) +#define COLOR_YELLOW RGB(255, 255, 0) + +#define COLOR_WHITE RGB(255, 255, 255) #define CONSOLE_WHITE COLOR_WHITE #define CONSOLE_BLACK COLOR_BLACK diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.c b/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.c index 205d7f10aa..721643f515 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.h b/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.h index ce0be096e8..18f95fecfd 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c index 35ab7c36d7..5d1080eadb 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.h b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.h index ff9e8ca724..2412631852 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c index 147504bd16..3d7b97e8ac 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.h b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.h index d850defa68..1fd8453e6f 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.c b/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.c index 46df0372e9..4ab2e4c25b 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.c @@ -1,6 +1,6 @@ /* * File : drv_sdio.c - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -125,7 +125,7 @@ rt_err_t sd_status(struct sdhci_pdata_t * pdat, unsigned int mask) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK) { return -RT_ERROR; - } + } return RT_EOK; } diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.h b/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.h index 5c052de90a..917c002daf 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_sdio.h @@ -1,6 +1,6 @@ /* * File : drv_sdio.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_spi.c b/bsp/raspberry-pi/raspi3-32/driver/drv_spi.c index eab7a08b39..c42d1cf013 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_spi.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_spi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_spi.h b/bsp/raspberry-pi/raspi3-32/driver/drv_spi.h index 9e4623b327..58ede93ef4 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_spi.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_spi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_timer.c b/bsp/raspberry-pi/raspi3-32/driver/drv_timer.c index 36a4fd2baf..117026e91c 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_timer.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -27,24 +27,24 @@ static rt_err_t raspi_systimer_start(rt_hwtimer_t *hwtimer, rt_uint32_t cnt, rt_ if (mode == HWTIMER_MODE_PERIOD) timer->cnt = cnt; else - timer->cnt = 0; + timer->cnt = 0; __sync_synchronize(); if (timer_id == 1) { rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1); STIMER_C1 = STIMER_CLO + cnt; - } + } else if (timer_id == 3) { rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3); STIMER_C3 = STIMER_CLO + cnt; } - else + else result = -RT_ERROR; __sync_synchronize(); - + return result; } @@ -56,7 +56,7 @@ static void raspi_systimer_stop(rt_hwtimer_t *hwtimer) rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1); else if (timer_id == 3) rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_3); - + } static rt_err_t raspi_systimer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg) @@ -75,7 +75,7 @@ static rt_err_t raspi_systimer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void * void rt_device_systimer_isr(int vector, void *param) { - + rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param; rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data; RT_ASSERT(timer != RT_NULL); @@ -86,18 +86,18 @@ void rt_device_systimer_isr(int vector, void *param) if (timer_id == 1) { STIMER_CS = 0x2; - STIMER_C1 = STIMER_CLO + timer->cnt; - } + STIMER_C1 = STIMER_CLO + timer->cnt; + } else if (timer_id == 3) { STIMER_CS = 0x8; - STIMER_C3 = STIMER_CLO + timer->cnt; + STIMER_C3 = STIMER_CLO + timer->cnt; } __sync_synchronize(); rt_device_hwtimer_isr(hwtimer); } - + static struct rt_hwtimer_device _hwtimer1; static struct rt_hwtimer_device _hwtimer3; diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_timer.h b/bsp/raspberry-pi/raspi3-32/driver/drv_timer.h index c85d4c9d1f..7fca63f6b7 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_timer.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_uart.c b/bsp/raspberry-pi/raspi3-32/driver/drv_uart.c index 18501b7849..293570e7ab 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_uart.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_uart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -125,7 +125,7 @@ static const struct rt_uart_ops _uart_ops = static void rt_hw_uart_isr(int irqno, void *param) { - struct rt_serial_device *serial = (struct rt_serial_device*)param; + struct rt_serial_device *serial = (struct rt_serial_device*)param; rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); } diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_uart.h b/bsp/raspberry-pi/raspi3-32/driver/drv_uart.h index 5211c19989..4f0a31bf52 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_uart.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_uart.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c index ad511913cb..b748a7b472 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -129,9 +129,9 @@ int reboot(void) PM_RSTS = PM_PASSWORD | r; // boot from partition 0 PM_WDOG = PM_PASSWORD | 10; PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET; - + while (1); - + return 0; } MSH_CMD_EXPORT(reboot,reboot system...); diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.h b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.h index 0b59ab79f3..ffb07ff5da 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.h +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/mbox.c b/bsp/raspberry-pi/raspi3-32/driver/mbox.c index bbd5183aa8..041017e471 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/mbox.c +++ b/bsp/raspberry-pi/raspi3-32/driver/mbox.c @@ -1,6 +1,6 @@ /* * File : mbox.c - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -41,7 +41,7 @@ int mbox_call(unsigned char ch, int mmu_enable) do { asm volatile("nop"); - } + } while (*MBOX_STATUS & MBOX_EMPTY); /* is it a response to our message? */ if (r == *MBOX_READ) diff --git a/bsp/raspberry-pi/raspi3-32/driver/mbox.h b/bsp/raspberry-pi/raspi3-32/driver/mbox.h index 5c59fd608c..3190603e8f 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/mbox.h +++ b/bsp/raspberry-pi/raspi3-32/driver/mbox.h @@ -1,6 +1,6 @@ /* * File : mbox.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-32/driver/raspi.h b/bsp/raspberry-pi/raspi3-32/driver/raspi.h index 19daa3541d..fedf4bcff8 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/raspi.h +++ b/bsp/raspberry-pi/raspi3-32/driver/raspi.h @@ -1,6 +1,6 @@ /* * File : rsapi.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/applications/main.c b/bsp/raspberry-pi/raspi3-64/applications/main.c index 397f40126b..bd7c917e64 100644 --- a/bsp/raspberry-pi/raspi3-64/applications/main.c +++ b/bsp/raspberry-pi/raspi3-64/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,10 +16,10 @@ void set_led(int state) //set state LED nyala atau mati { if (state==1) //LED nyala - { + { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = 0x00038041; // get serial number command mbox[3] = 8; // buffer size mbox[4] = 0; @@ -29,10 +29,10 @@ void set_led(int state) //set state LED nyala atau mati mbox_call(8, MMU_DISABLE); } else if (state==0) //LED mati - { + { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = 0x00038041; // get serial number command mbox[3] = 8; // buffer size mbox[4] = 0; diff --git a/bsp/raspberry-pi/raspi3-64/applications/mnt.c b/bsp/raspberry-pi/raspi3-64/applications/mnt.c index 33b466434c..01e97b325b 100644 --- a/bsp/raspberry-pi/raspi3-64/applications/mnt.c +++ b/bsp/raspberry-pi/raspi3-64/applications/mnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/board.c b/bsp/raspberry-pi/raspi3-64/driver/board.c index 5d15dda987..531a0a0dfa 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/board.c +++ b/bsp/raspberry-pi/raspi3-64/driver/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -62,7 +62,7 @@ void rt_hw_timer_init(void) timerStep = rt_hw_get_gtimer_frq(); __DSB(); timerStep /= RT_TICK_PER_SECOND; - + rt_hw_gtimer_enable(); rt_hw_set_gtimer_val(timerStep); core0_timer_enable_interrupt_controller(); @@ -90,7 +90,7 @@ void idle_wfi(void) } /** - * Initialize the Hardware related stuffs. Called from rtthread_startup() + * Initialize the Hardware related stuffs. Called from rtthread_startup() * after interrupt disabled. */ void rt_hw_board_init(void) @@ -105,7 +105,7 @@ void rt_hw_board_init(void) armv8_map(0x3f804000, 0x3f804000, 0x1000, MEM_ATTR_IO);//i2c0 armv8_map(0x3f205000, 0x3f205000, 0x1000, MEM_ATTR_IO);//i2c1 mmu_enable(); - + /* initialize hardware interrupt */ rt_hw_interrupt_init(); // in libcpu/interrupt.c. Set some data structures, no operation on device rt_hw_vector_init(); // in libcpu/interrupt.c. == rt_cpu_vector_set_base((rt_ubase_t)&system_vectors); diff --git a/bsp/raspberry-pi/raspi3-64/driver/board.h b/bsp/raspberry-pi/raspi3-64/driver/board.h index b44c245a17..6b51f0408e 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/board.h +++ b/bsp/raspberry-pi/raspi3-64/driver/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_fb.c b/bsp/raspberry-pi/raspi3-64/driver/drv_fb.c index cabaded5fd..204fa0c868 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_fb.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_fb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -116,7 +116,7 @@ rt_err_t hdmi_fb_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -const static struct rt_device_ops hdmi_fb_ops = +const static struct rt_device_ops hdmi_fb_ops = { RT_NULL, hdmi_fb_open, @@ -157,7 +157,7 @@ rt_uint32_t bcm283x_mbox_fb_get_gpiovirt(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT; mbox[3] = 4; // buffer size mbox[4] = 0; // len @@ -174,7 +174,7 @@ rt_uint32_t bcm283x_mbox_fb_get_pitch(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_GET_PITCH; mbox[3] = 4; // buffer size mbox[4] = 0; // len @@ -191,7 +191,7 @@ void bcm283x_mbox_fb_set_porder(int rgb) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER; mbox[3] = 4; // buffer size mbox[4] = 4; // len @@ -207,7 +207,7 @@ void bcm283x_mbox_fb_setoffset(int xoffset, int yoffset) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -225,7 +225,7 @@ void bcm283x_mbox_fb_setalpha(int alpha) mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE; mbox[3] = 4; // buffer size mbox[4] = 4; // len diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_fb.h b/bsp/raspberry-pi/raspi3-64/driver/drv_fb.h index 9fdac754cd..1074dc79c7 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_fb.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_fb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.c b/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.c index 0cd6abb84e..04b5cdf162 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.h b/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.h index f51817b035..009f4e3edc 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c index ce0fd7ae74..b7c6067ae4 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -130,7 +130,7 @@ static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, volatile rt_base_t base = (volatile rt_base_t)(bus->parent.user_data); if (bus->addr == 0) - base = BCM283X_BSC0_BASE; + base = BCM283X_BSC0_BASE; else base = BCM283X_BSC1_BASE; diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.h b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.h index 9b652b746f..2412631852 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c index 18fd6474a2..5d43c39073 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h index 82306068ca..4af28efa17 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.c b/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.c index 785f335ebb..a46115804a 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.c @@ -1,6 +1,6 @@ /* * File : drv_sdio.c - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -128,7 +128,7 @@ rt_err_t sd_status(struct sdhci_pdata_t * pdat, unsigned int mask) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK) { return -RT_ERROR; - } + } return RT_EOK; } diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.h b/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.h index 5c052de90a..917c002daf 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_sdio.h @@ -1,6 +1,6 @@ /* * File : drv_sdio.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_spi.c b/bsp/raspberry-pi/raspi3-64/driver/drv_spi.c index 0b0c8881a8..4c63fe9aae 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_spi.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_spi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_spi.h b/bsp/raspberry-pi/raspi3-64/driver/drv_spi.h index 9e4623b327..58ede93ef4 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_spi.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_spi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_timer.c b/bsp/raspberry-pi/raspi3-64/driver/drv_timer.c index 00b31897d8..a8cb5149d4 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_timer.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -29,24 +29,24 @@ static rt_err_t raspi_systimer_start(rt_hwtimer_t *hwtimer, rt_uint32_t cnt, rt_ if (mode == HWTIMER_MODE_PERIOD) timer->cnt = cnt; else - timer->cnt = 0; + timer->cnt = 0; __sync_synchronize(); if (timer_id == 1) { rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1); STIMER_C1 = STIMER_CLO + cnt; - } + } else if (timer_id == 3) { rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3); STIMER_C3 = STIMER_CLO + cnt; } - else + else result = -RT_ERROR; __sync_synchronize(); - + return result; } @@ -58,7 +58,7 @@ static void raspi_systimer_stop(rt_hwtimer_t *hwtimer) rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1); else if (timer_id == 3) rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_3); - + } static rt_err_t raspi_systimer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg) @@ -77,7 +77,7 @@ static rt_err_t raspi_systimer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void * void rt_device_systimer_isr(int vector, void *param) { - + rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param; rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data; RT_ASSERT(timer != RT_NULL); @@ -88,12 +88,12 @@ void rt_device_systimer_isr(int vector, void *param) if (timer_id == 1) { STIMER_CS = 0x2; - STIMER_C1 = STIMER_CLO + timer->cnt; - } + STIMER_C1 = STIMER_CLO + timer->cnt; + } else if (timer_id == 3) { STIMER_CS = 0x8; - STIMER_C3 = STIMER_CLO + timer->cnt; + STIMER_C3 = STIMER_CLO + timer->cnt; } __sync_synchronize(); diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_timer.h b/bsp/raspberry-pi/raspi3-64/driver/drv_timer.h index c18e3d893c..ebe5536fa5 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_timer.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_uart.c b/bsp/raspberry-pi/raspi3-64/driver/drv_uart.c index 62fcb966b4..6eb7a46f10 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_uart.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_uart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -124,7 +124,7 @@ static const struct rt_uart_ops _uart_ops = static void rt_hw_uart_isr(int irqno, void *param) { - struct rt_serial_device *serial = (struct rt_serial_device*)param; + struct rt_serial_device *serial = (struct rt_serial_device*)param; rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); } diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_uart.h b/bsp/raspberry-pi/raspi3-64/driver/drv_uart.h index 894c6098db..76072f938e 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_uart.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_uart.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c index 245f4df197..f90a251ad0 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -130,9 +130,9 @@ int reboot(void) PM_RSTS = PM_PASSWORD | r; // boot from partition 0 PM_WDOG = PM_PASSWORD | 10; PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET; - + while (1); - + return 0; } MSH_CMD_EXPORT(reboot,reboot system...); diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.h b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.h index 0b59ab79f3..ffb07ff5da 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi3-64/driver/mbox.c b/bsp/raspberry-pi/raspi3-64/driver/mbox.c index dc09ecab4b..fbfc456b4d 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/mbox.c +++ b/bsp/raspberry-pi/raspi3-64/driver/mbox.c @@ -1,6 +1,6 @@ /* * File : mbox.c - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -41,7 +41,7 @@ int mbox_call(unsigned char ch, int mmu_enable) /* is it a response to our message? */ if (r == *MBOX_READ){ /* is it a valid successful response? */ - // rt_kprintf("mbox: %x, %x, %x, %x, %x, %x, %x, %x\n", mbox[0], mbox[1], mbox[2], mbox[3], mbox[4], mbox[5], mbox[6], mbox[7]); + // rt_kprintf("mbox: %x, %x, %x, %x, %x, %x, %x, %x\n", mbox[0], mbox[1], mbox[2], mbox[3], mbox[4], mbox[5], mbox[6], mbox[7]); return mbox[1] == MBOX_RESPONSE; } } @@ -52,12 +52,12 @@ int bcm283x_mbox_hardware_get_model(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL; mbox[3] = 4; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -70,12 +70,12 @@ int bcm283x_mbox_hardware_get_revison(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_REV; + + mbox[2] = MBOX_TAG_HARDWARE_GET_REV; mbox[3] = 4; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -88,12 +88,12 @@ int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_MAC_ADDRESS; + + mbox[2] = MBOX_TAG_HARDWARE_GET_MAC_ADDRESS; mbox[3] = 6; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -114,12 +114,12 @@ int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_SERIAL; + + mbox[2] = MBOX_TAG_HARDWARE_GET_SERIAL; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -134,12 +134,12 @@ int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_ARM_MEMORY; + + mbox[2] = MBOX_TAG_HARDWARE_GET_ARM_MEMORY; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -147,7 +147,7 @@ int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size) *base = mbox[5]; *size = mbox[6]; - + return 0; } @@ -156,12 +156,12 @@ int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -169,7 +169,7 @@ int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size) *base = mbox[5]; *size = mbox[6]; - + return 0; } @@ -177,8 +177,8 @@ int bcm283x_mbox_clock_get_turbo(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_TURBO; + + mbox[2] = MBOX_TAG_CLOCK_GET_TURBO; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -200,8 +200,8 @@ int bcm283x_mbox_clock_set_turbo(int level) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_SET_TURBO; + + mbox[2] = MBOX_TAG_CLOCK_SET_TURBO; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -223,7 +223,7 @@ int bcm283x_mbox_clock_get_state(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_GET_STATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -246,7 +246,7 @@ int bcm283x_mbox_clock_set_state(int id, int state) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_SET_STATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -269,8 +269,8 @@ int bcm283x_mbox_clock_get_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_RATE; + + mbox[2] = MBOX_TAG_CLOCK_GET_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -292,7 +292,7 @@ int bcm283x_mbox_clock_set_rate(int id, int rate) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -315,7 +315,7 @@ int bcm283x_mbox_clock_get_max_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -338,8 +338,8 @@ int bcm283x_mbox_clock_get_min_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_MIN_RATE; + + mbox[2] = MBOX_TAG_CLOCK_GET_MIN_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -361,7 +361,7 @@ int bcm283x_mbox_power_get_state(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_POWER_GET_STATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -384,7 +384,7 @@ int bcm283x_mbox_power_set_state(int id, int state) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_POWER_SET_STATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -407,7 +407,7 @@ int bcm283x_mbox_temp_get(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_TEMP_GET; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -430,7 +430,7 @@ int bcm283x_mbox_temp_get_max(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_TEMP_GET_MAX; mbox[3] = 8; // buffer size mbox[4] = 4; // len diff --git a/bsp/raspberry-pi/raspi3-64/driver/mbox.h b/bsp/raspberry-pi/raspi3-64/driver/mbox.h index f235691d7b..b7aa2e95c9 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/mbox.h +++ b/bsp/raspberry-pi/raspi3-64/driver/mbox.h @@ -1,6 +1,6 @@ /* * File : mbox.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -32,7 +32,7 @@ extern volatile unsigned int* mbox; /* tags */ #define MBOX_TAG_SETPOWER 0x28001 #define MBOX_TAG_SETCLKRATE 0x38002 -#define MBOX_GET_MAC_ADDRESS 0x10003 +#define MBOX_GET_MAC_ADDRESS 0x10003 #define MBOX_TAG_LAST 0 #define MMIO_BASE 0x3F000000 @@ -47,12 +47,12 @@ extern volatile unsigned int* mbox; #define MBOX_FULL 0x80000000 #define MBOX_EMPTY 0x40000000 -#define DEVICE_ID_SD_CARD 0 -#define DEVICE_ID_USB_HCD 3 -#define POWER_STATE_OFF (0 << 0) -#define POWER_STATE_ON (1 << 0) -#define POWER_STATE_WAIT (1 << 1) -#define POWER_STATE_NO_DEVICE (1 << 1) // in response +#define DEVICE_ID_SD_CARD 0 +#define DEVICE_ID_USB_HCD 3 +#define POWER_STATE_OFF (0 << 0) +#define POWER_STATE_ON (1 << 0) +#define POWER_STATE_WAIT (1 << 1) +#define POWER_STATE_NO_DEVICE (1 << 1) // in response #define MMU_ENABLE 1 #define MMU_DISABLE 0 diff --git a/bsp/raspberry-pi/raspi3-64/driver/raspi.h b/bsp/raspberry-pi/raspi3-64/driver/raspi.h index 9a5de2af02..a24640d07d 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/raspi.h +++ b/bsp/raspberry-pi/raspi3-64/driver/raspi.h @@ -1,6 +1,6 @@ /* * File : rsapi.h - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/applications/main.c b/bsp/raspberry-pi/raspi4-32/applications/main.c index 15dc74dc58..f2248e1660 100644 --- a/bsp/raspberry-pi/raspi4-32/applications/main.c +++ b/bsp/raspberry-pi/raspi4-32/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -17,7 +17,7 @@ int main(int argc, char** argv) { rt_kprintf("Hi, this is RT-Thread!!\n"); - + rt_pin_mode(ACTLED, PIN_MODE_OUTPUT); while(1) diff --git a/bsp/raspberry-pi/raspi4-32/applications/mnt.c b/bsp/raspberry-pi/raspi4-32/applications/mnt.c index ae224e8e89..ea67a4a46a 100644 --- a/bsp/raspberry-pi/raspi4-32/applications/mnt.c +++ b/bsp/raspberry-pi/raspi4-32/applications/mnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/board.c b/bsp/raspberry-pi/raspi4-32/driver/board.c index 455bd28ee2..c9571316d1 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/board.c +++ b/bsp/raspberry-pi/raspi4-32/driver/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,7 +22,7 @@ struct mem_desc platform_mem_desc[] = { {0x0, 0x6400000, 0x0, NORMAL_MEM}, {0x8000000, 0x8800000, 0x8000000, DEVICE_MEM}, //mbox msg {0x0E000000, 0x0EE00000, 0x0E000000, DEVICE_MEM}, //framebuffer - {0x0F400000, 0x0FA00000, 0x0F400000, DEVICE_MEM}, //dsi_touch + {0x0F400000, 0x0FA00000, 0x0F400000, DEVICE_MEM}, //dsi_touch {0xFD500000, 0xFDA00000, 0xFD500000, DEVICE_MEM}, //gmac {0xFE000000, 0xFF000000, 0xFE000000, DEVICE_MEM}, //peripheral {0xFF800000, 0xFFA00000, 0xFF800000, DEVICE_MEM} //gic @@ -65,7 +65,7 @@ void idle_wfi(void) } /** - * Initialize the Hardware related stuffs. Called from rtthread_startup() + * Initialize the Hardware related stuffs. Called from rtthread_startup() * after interrupt disabled. */ void rt_hw_board_init(void) diff --git a/bsp/raspberry-pi/raspi4-32/driver/board.h b/bsp/raspberry-pi/raspi4-32/driver/board.h index d675cc658e..29019514b9 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/board.h +++ b/bsp/raspberry-pi/raspi4-32/driver/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.c b/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.c index 6b839f5e23..cdf809cc77 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.h b/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.h index 9de47bf191..0e7453ca3d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_bluetooth.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_dma.c b/bsp/raspberry-pi/raspi4-32/driver/drv_dma.c index 4ec94896c1..a258dd41e4 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_dma.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_dma.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_dma.h b/bsp/raspberry-pi/raspi4-32/driver/drv_dma.h index 1b79eb1c95..83fbcbdd0e 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_dma.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_dma.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_eth.c b/bsp/raspberry-pi/raspi4-32/driver/drv_eth.c index a2f78ffd61..58683b422d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_eth.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_eth.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -670,7 +670,7 @@ struct pbuf *rt_eth_rx(rt_device_t device) int rt_hw_eth_init(void) { rt_uint8_t mac_addr[6]; - + rt_sem_init(&sem_lock, "eth_lock", 1, RT_IPC_FLAG_FIFO); rt_sem_init(&link_ack, "link_ack", 0, RT_IPC_FLAG_FIFO); diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_eth.h b/bsp/raspberry-pi/raspi4-32/driver/drv_eth.h index f7916ee5e1..39bfc87913 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_eth.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_eth.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.c b/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.c index b2d2ed79c4..7a3d2604a1 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -102,7 +102,7 @@ static void gpio_set_pud(GPIO_PIN pin, GPIO_PUPD_FUNC mode) case 3: reg_value = GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE); GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE) = (reg_value | (mode << (fselrest*2))); - break; + break; default: break; } @@ -194,7 +194,7 @@ static int raspi_pin_read(struct rt_device *device, rt_base_t pin) else { pin_level = 0; - } + } } else @@ -422,7 +422,7 @@ int rt_hw_gpio_init(void) GPIO_REG_GPAFEN0(GPIO_BASE) = 0x0; GPIO_REG_GPAFEN0(GPIO_BASE) = 0x0; - + rt_hw_interrupt_install(IRQ_GPIO0, gpio_irq_handler, &_g_gpio_irq_tbl[0], "gpio0_irq"); rt_hw_interrupt_umask(IRQ_GPIO0); diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.h b/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.h index 7594759f97..78c1709965 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c index f596eccc89..3a7503a04d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,7 +16,7 @@ /* * (3.3v) -1 2- * (SDA1/SDA3) -3 4- -* (SCL1/SCL3) -5 6- +* (SCL1/SCL3) -5 6- * (SDA3) -7 8- * -9 10- * -11 12- @@ -268,7 +268,7 @@ static struct raspi_i2c_hw_config hw_device4 = .scl_pin = GPIO_PIN_7, #else .sda_pin = GPIO_PIN_8, - .scl_pin = GPIO_PIN_9, + .scl_pin = GPIO_PIN_9, #endif .sda_mode = ALT5, .scl_mode = ALT5, diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.h b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.h index e02c8887f0..bfb724ad93 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.c b/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.c index 4d88668eee..d0f63cfce0 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -128,7 +128,7 @@ rt_err_t sd_status(struct sdhci_pdata_t * pdat, unsigned int mask) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK) { return -RT_ERROR; - } + } return RT_EOK; } @@ -450,7 +450,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock) sdHostVer = (temp & HOST_SPEC_NUM) >> HOST_SPEC_NUM_SHIFT; int cdiv = sd_get_clock_divider(sdHostVer, mmc_base_clock, clock); temp = read32((pdat->virt + EMMC_CONTROL1)); - temp |= 1; + temp |= 1; temp |= cdiv; temp |= (7 << 16); @@ -639,7 +639,7 @@ int raspi_sdmmc_init(void) #endif mmcsd_change(host); #endif - return RT_EOK; + return RT_EOK; err: if (host) rt_free(host); if (sdhci) rt_free(sdhci); diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.h b/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.h index 5919bd64d3..0481a82e6d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_sdio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -85,7 +85,7 @@ struct sdhci_t rt_uint32_t width; rt_uint32_t clock; rt_err_t removeable; - void * sdcard; + void * sdcard; rt_err_t (*detect)(struct sdhci_t * sdhci); rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width); diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_spi.c b/bsp/raspberry-pi/raspi4-32/driver/drv_spi.c index f0c6351d7f..9c188a8fa9 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_spi.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_spi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -98,11 +98,11 @@ static rt_err_t raspi_spi_configure(struct rt_spi_device *device, struct rt_spi_ if(cfg->mode & RT_SPI_CS_HIGH) { - SPI_REG_CS(hwcfg->hw_base) |= SPI_CS_CSPOL_HIGH; + SPI_REG_CS(hwcfg->hw_base) |= SPI_CS_CSPOL_HIGH; } else { - SPI_REG_CS(hwcfg->hw_base) &= ~SPI_CS_CSPOL_HIGH; + SPI_REG_CS(hwcfg->hw_base) &= ~SPI_CS_CSPOL_HIGH; } return RT_EOK; } @@ -157,7 +157,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me if (config.mode & RT_SPI_MSB) { flag = 1; - } + } else { flag = 0; @@ -172,7 +172,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me { SPI_REG_CLK(hwcfg->hw_base) = (RPI_CORE_CLK_HZ / (config.max_hz)); } - + //cs_pin spi0.0 if(cs_pin == GPIO_PIN_8) { diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_spi.h b/bsp/raspberry-pi/raspi4-32/driver/drv_spi.h index 9cd8e031e4..8fa8baabe0 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_spi.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_spi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -70,7 +70,7 @@ struct raspi_spi_hw_config GPIO_FUNC ce2_mode; #endif rt_ubase_t hw_base; - + }; struct raspi_spi_device diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_uart.c b/bsp/raspberry-pi/raspi4-32/driver/drv_uart.c index 34b9e1d945..1a3100c745 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_uart.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_uart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -211,7 +211,7 @@ static const struct rt_uart_ops _uart_ops = #ifdef RT_USING_UART1 static void rt_hw_aux_uart_isr(int irqno, void *param) { - struct rt_serial_device *serial = (struct rt_serial_device*)param; + struct rt_serial_device *serial = (struct rt_serial_device*)param; rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); } #endif @@ -220,7 +220,7 @@ static void rt_hw_uart_isr(int irqno, void *param) { #ifdef RT_USING_UART0 if((PACTL_CS & IRQ_UART0) == IRQ_UART0) - { + { PACTL_CS &= ~(IRQ_UART0); rt_hw_serial_isr(&_serial0, RT_SERIAL_EVENT_RX_IND); PL011_REG_ICR(UART0_BASE) = PL011_INTERRUPT_RECEIVE; diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_uart.h b/bsp/raspberry-pi/raspi4-32/driver/drv_uart.h index d57f4e52f4..b2a4552872 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_uart.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_uart.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c index 3c091354bb..a9b2e8fc0c 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -128,7 +128,7 @@ void reboot(void) PM_RSTS |= (PM_PASSWORD | r); // boot from partition 0 PM_WDOG |= (PM_PASSWORD | 0x0A); PM_RSTC |= (PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET); - + while (1); } MSH_CMD_EXPORT(reboot,reboot system...); diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.h b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.h index 4c9454ed91..6998792e0d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.h +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.c b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.c index 955e55bcf5..175c6cd907 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.c +++ b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -123,7 +123,7 @@ rt_err_t hdmi_fb_control(rt_device_t dev, int cmd, void *args) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops hdmi_fb_ops = +const static struct rt_device_ops hdmi_fb_ops = { RT_NULL, hdmi_fb_open, @@ -165,7 +165,7 @@ rt_uint32_t bcm271x_mbox_fb_get_gpiovirt(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT; mbox[3] = 4; // buffer size mbox[4] = 0; // len @@ -182,7 +182,7 @@ rt_uint32_t bcm271x_mbox_fb_get_pitch(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_GET_PITCH; mbox[3] = 4; // buffer size mbox[4] = 0; // len @@ -199,7 +199,7 @@ void bcm271x_mbox_fb_set_porder(int rgb) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER; mbox[3] = 4; // buffer size mbox[4] = 4; // len @@ -215,7 +215,7 @@ void bcm271x_mbox_fb_setoffset(int xoffset, int yoffset) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -233,7 +233,7 @@ void bcm271x_mbox_fb_setalpha(int alpha) mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE; mbox[3] = 4; // buffer size mbox[4] = 4; // len diff --git a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.h b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.h index c9a06358d0..b9901e204b 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.h +++ b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_hdmi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_ili9486.c b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_ili9486.c index c2317bd112..7db4940c97 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_ili9486.c +++ b/bsp/raspberry-pi/raspi4-32/driver/lcd/drv_ili9486.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -89,7 +89,7 @@ void lcd_write_data(rt_uint8_t data) } /*Ser rotation of the screen - changes x0 and y0*/ -static inline void lcd_set_rotation(uint8_t rotation) +static inline void lcd_set_rotation(uint8_t rotation) { writeCommand(lcd_dev, 0x36); rt_thread_mdelay(100); @@ -134,7 +134,7 @@ static inline void lcd_set_rotation(uint8_t rotation) lcd_write_data(0x01); lcd_write_data(0xE0); } - + if((rotation == SCREEN_HORIZONTAL_1) || (rotation == SCREEN_HORIZONTAL_2)) { lcd_write_commmand(0x2B); @@ -177,7 +177,7 @@ static inline void fast_send_data(void) rt_sem_release(&lcd_spi_lock); } -static inline void lcd_show(void) +static inline void lcd_show(void) { lcd_write_commmand(0x2C); // Memory write? @@ -188,11 +188,11 @@ static inline void lcd_show(void) fast_send_data(); #else int i, j; - for (i = 0 ; i < 30 ; i ++) + for (i = 0 ; i < 30 ; i ++) { uint16_t *tx_data = (uint16_t*)&send_buffer[5120* i]; int32_t data_sz = 5120; - for( j=0; jdepth >= 3) { - uint32_t *addr_32bit = (uint32_t*) (fb->vaddr) + (fb->height - CHAR_H) * fb->width; + uint32_t *addr_32bit = (uint32_t*) (fb->vaddr) + (fb->height - CHAR_H) * fb->width; for (i = 0; i < (CHAR_H * fb->width); i++) { @@ -64,7 +64,7 @@ static void newline(fb_t* fb) } else { - uint16_t *addr_16bit = (uint16_t*) (fb->vaddr) + (fb->height - CHAR_H) * fb->width; + uint16_t *addr_16bit = (uint16_t*) (fb->vaddr) + (fb->height - CHAR_H) * fb->width; for (i = 0; i < (CHAR_H * fb->width); i++) { @@ -107,7 +107,7 @@ static void fb_draw_char(fb_t *fb, char s) { *((unsigned short*) (addr + line)) = ((int) *(glyph + ((i)/8)) * 1) & mask ? fb->fore : fb->back; } - + mask >>= 1; if(mask == 0) { @@ -170,12 +170,12 @@ void fb_print(char *s) { rt_device_control(console_dev,RTGRAPHIC_CTRL_RECT_UPDATE, RT_NULL); } -#endif +#endif } #ifndef LCD_CONSOLE_FLUSH_NOW void lcd_console_task_entry(void *param) -{ +{ fb_t *fb = (fb_t *)param; while (1) { @@ -186,7 +186,7 @@ void lcd_console_task_entry(void *param) } rt_thread_mdelay(LCD_CONSOLE_DELAY); } - + } #endif @@ -199,7 +199,7 @@ int lcd_console_init(void) rt_kprintf("no console dev!\n"); return 0; } - + if(console_dev->ref_count >= 1) { rt_kprintf("lcd console has open!\n"); @@ -209,7 +209,7 @@ int lcd_console_init(void) rt_device_open(console_dev,RT_DEVICE_OFLAG_RDWR); rt_device_control(console_dev, RTGRAPHIC_CTRL_GET_INFO, &info); - + virt_buffer = (rt_uint8_t* )rt_malloc(info.width * info.height * (info.bits_per_pixel/8)); rt_memset(virt_buffer, 0 , info.width * info.height * (info.bits_per_pixel/8)); console_fb.width = info.width; @@ -246,7 +246,7 @@ int lcd_console_init(void) * #ifdef USING_LCD_CONSOLE * fb_print((char*)rt_log_buf); * #endif - * + * * remove rt_console_set_device(CONSOLE_NAME); */ rt_console_set_device(CONSOLE_NAME); diff --git a/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_console.h b/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_console.h index ebe6afa068..2bc7a1ceb1 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_console.h +++ b/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_console.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,10 +15,10 @@ #define RGB(r, g, b) ((((r))<<16) | (((g))<<8) | ((b))) #define COLOR_BLACK RGB(0, 0, 0) -#define COLOR_GREEN RGB(0, 255, 0) -#define COLOR_CYAN RGB(0, 255, 255) -#define COLOR_RED RGB(255, 0, 0) -#define COLOR_YELLOW RGB(255, 255, 0) +#define COLOR_GREEN RGB(0, 255, 0) +#define COLOR_CYAN RGB(0, 255, 255) +#define COLOR_RED RGB(255, 0, 0) +#define COLOR_YELLOW RGB(255, 255, 0) #define COLOR_WHITE RGB(255, 255, 255) #define CONSOLE_WHITE_32 COLOR_WHITE diff --git a/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_font_20.h b/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_font_20.h index 7ef56d7e3c..55610713d9 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_font_20.h +++ b/bsp/raspberry-pi/raspi4-32/driver/lcd/lcd_font_20.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/mbox.c b/bsp/raspberry-pi/raspi4-32/driver/mbox.c index 0f993f945a..ecb357c82d 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/mbox.c +++ b/bsp/raspberry-pi/raspi4-32/driver/mbox.c @@ -1,6 +1,6 @@ /* * File : mbox.c - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,7 +15,7 @@ #include "mmu.h" //volatile unsigned int __attribute__((aligned(16))) mbox[36]; volatile unsigned int *mbox = (volatile unsigned int *) MBOX_ADDR; -#define BUS_ADDRESS(phys) (((phys) & ~0xC0000000) | 0xC0000000) +#define BUS_ADDRESS(phys) (((phys) & ~0xC0000000) | 0xC0000000) /** * Make a mailbox call. Returns 0 on failure, non-zero on success @@ -53,8 +53,8 @@ int bcm271x_mbox_get_touch(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_GET_TOUCHBUF; + + mbox[2] = MBOX_TAG_GET_TOUCHBUF; mbox[3] = 4; // buffer size mbox[4] = 0; // len @@ -76,7 +76,7 @@ int bcm271x_notify_reboot(void) mbox[4] = 0x00000000; // size of the data mbox[5] = 0x00000000; // request - mbox[6] = MBOX_TAG_LAST; + mbox[6] = MBOX_TAG_LAST; mbox_call(8, MMU_DISABLE); return 0; } @@ -89,7 +89,7 @@ int bcm271x_notify_xhci_reset(void) mbox[3] = 0x00000004; // length + 4 mbox[4] = 0x00000004; // size of the data mbox[5] = 0x00100000; // request - mbox[6] = MBOX_TAG_LAST; + mbox[6] = MBOX_TAG_LAST; mbox_call(8, MMU_DISABLE); return 0; } @@ -98,7 +98,7 @@ int bcm271x_gpu_enable(void) { mbox[0] = 12*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[3] = 0x00000008; // (the tag id) mbox[4] = 0x00000008; // (the tag id) @@ -117,12 +117,12 @@ int bcm271x_mbox_hardware_get_model(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL; mbox[3] = 4; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -135,12 +135,12 @@ int bcm271x_mbox_hardware_get_revison(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_REV; + + mbox[2] = MBOX_TAG_HARDWARE_GET_REV; mbox[3] = 4; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -153,12 +153,12 @@ int bcm271x_mbox_hardware_get_mac_address(uint8_t * mac) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_MAC_ADDRESS; + + mbox[2] = MBOX_TAG_HARDWARE_GET_MAC_ADDRESS; mbox[3] = 6; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -179,12 +179,12 @@ int bcm271x_mbox_hardware_get_serial(rt_uint64_t* sn) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_SERIAL; + + mbox[2] = MBOX_TAG_HARDWARE_GET_SERIAL; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -199,12 +199,12 @@ int bcm271x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_HARDWARE_GET_ARM_MEMORY; + + mbox[2] = MBOX_TAG_HARDWARE_GET_ARM_MEMORY; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -212,7 +212,7 @@ int bcm271x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size) *base = mbox[5]; *size = mbox[6]; - + return 0; } @@ -221,12 +221,12 @@ int bcm271x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY; mbox[3] = 8; // buffer size mbox[4] = 0; // len - mbox[5] = 0; + mbox[5] = 0; mbox[6] = 0; mbox[7] = MBOX_TAG_LAST; @@ -234,7 +234,7 @@ int bcm271x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size) *base = mbox[5]; *size = mbox[6]; - + return 0; } @@ -242,8 +242,8 @@ int bcm271x_mbox_clock_get_turbo(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_TURBO; + + mbox[2] = MBOX_TAG_CLOCK_GET_TURBO; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -265,8 +265,8 @@ int bcm271x_mbox_clock_set_turbo(int level) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_SET_TURBO; + + mbox[2] = MBOX_TAG_CLOCK_SET_TURBO; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -288,7 +288,7 @@ int bcm271x_mbox_clock_get_state(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_GET_STATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -311,7 +311,7 @@ int bcm271x_mbox_clock_set_state(int id, int state) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_SET_STATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -334,8 +334,8 @@ int bcm271x_mbox_clock_get_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_RATE; + + mbox[2] = MBOX_TAG_CLOCK_GET_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -357,7 +357,7 @@ int bcm271x_mbox_clock_set_rate(int id, int rate) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -380,7 +380,7 @@ int bcm271x_mbox_clock_get_max_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -403,8 +403,8 @@ int bcm271x_mbox_clock_get_min_rate(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - - mbox[2] = MBOX_TAG_CLOCK_GET_MIN_RATE; + + mbox[2] = MBOX_TAG_CLOCK_GET_MIN_RATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -426,7 +426,7 @@ int bcm271x_mbox_power_get_state(int id) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_POWER_GET_STATE; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -449,7 +449,7 @@ int bcm271x_mbox_power_set_state(int id, int state) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_POWER_SET_STATE; mbox[3] = 8; // buffer size mbox[4] = 8; // len @@ -472,7 +472,7 @@ int bcm271x_mbox_temp_get(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_TEMP_GET; mbox[3] = 8; // buffer size mbox[4] = 4; // len @@ -495,7 +495,7 @@ int bcm271x_mbox_temp_get_max(void) { mbox[0] = 8*4; // length of the message mbox[1] = MBOX_REQUEST; // this is a request message - + mbox[2] = MBOX_TAG_TEMP_GET_MAX; mbox[3] = 8; // buffer size mbox[4] = 4; // len diff --git a/bsp/raspberry-pi/raspi4-32/driver/mbox.h b/bsp/raspberry-pi/raspi4-32/driver/mbox.h index 7a05597de4..2c69bcf55a 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/mbox.h +++ b/bsp/raspberry-pi/raspi4-32/driver/mbox.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/raspi4.h b/bsp/raspberry-pi/raspi4-32/driver/raspi4.h index 72e212ff85..bba81ea311 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/raspi4.h +++ b/bsp/raspberry-pi/raspi4-32/driver/raspi4.h @@ -149,8 +149,8 @@ typedef enum { } while (0) \ //External Mass Media Controller (SD Card) -#define MMC0_BASE_ADDR (PER_BASE+0x300000) -#define MMC2_BASE_ADDR (PER_BASE+0x340000) +#define MMC0_BASE_ADDR (PER_BASE+0x300000) +#define MMC2_BASE_ADDR (PER_BASE+0x340000) #define ETH_IRQ (160+29) @@ -162,7 +162,7 @@ typedef enum { #define BSC5_BASE_OFFSET (0x205A80) #define BSC6_BASE_OFFSET (0x205C00) -//BSC2 and BSC7 masters are dedicated for use by the +//BSC2 and BSC7 masters are dedicated for use by the //HDMI interfaces and should not be accessed byuser programs. #define BSC0_BASE (PER_BASE + BSC0_BASE_OFFSET) #define BSC1_BASE (PER_BASE + BSC1_BASE_OFFSET) diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c index 894ef1f25c..3f9dbb83ad 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -58,7 +58,7 @@ static void dsi_touch_thread_entry(void *param) rt_kprintf("init dsi touch err!\n"); return; } - + while (1) { struct touch_regs *regs = (struct touch_regs *)touchbuf; @@ -73,7 +73,7 @@ static void dsi_touch_thread_entry(void *param) { touch_state = 0; } - rt_thread_mdelay(50); + rt_thread_mdelay(50); } } diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.h b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.h index 6d6439f199..ea70191dde 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.h +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c index 489701f079..5911b5b6e3 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -104,7 +104,7 @@ no pressed:(0x800,0xfff) ------------------------------------ */ #define XMIN 0x800 -#define YMAX 0xfff +#define YMAX 0xfff void read_tp(void *dev, rt_uint16_t *x, rt_uint16_t *y) { struct rt_spi_device *touch_dev = (struct rt_spi_device *)dev; diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.h b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.h index 5b28c0a7dd..0a88546250 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.h +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-64/applications/main.c b/bsp/raspberry-pi/raspi4-64/applications/main.c index 9664e67d01..9400e2a598 100644 --- a/bsp/raspberry-pi/raspi4-64/applications/main.c +++ b/bsp/raspberry-pi/raspi4-64/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-64/driver/board.c b/bsp/raspberry-pi/raspi4-64/driver/board.c index 79a24d184f..0fbd4921f8 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/board.c +++ b/bsp/raspberry-pi/raspi4-64/driver/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -44,7 +44,7 @@ void rt_hw_timer_init(void) timerStep = rt_hw_get_gtimer_frq(); __DSB(); timerStep /= RT_TICK_PER_SECOND; - + rt_hw_gtimer_enable(); rt_hw_set_gtimer_val(timerStep); core0_timer_enable_interrupt_controller(); @@ -56,7 +56,7 @@ void idle_wfi(void) } /** - * Initialize the Hardware related stuffs. Called from rtthread_startup() + * Initialize the Hardware related stuffs. Called from rtthread_startup() * after interrupt disabled. */ void rt_hw_board_init(void) diff --git a/bsp/raspberry-pi/raspi4-64/driver/board.h b/bsp/raspberry-pi/raspi4-64/driver/board.h index d675cc658e..29019514b9 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/board.h +++ b/bsp/raspberry-pi/raspi4-64/driver/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.c b/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.c index bba20a86a4..f526ff99e6 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.c +++ b/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -71,7 +71,7 @@ static void raspi_pin_write(struct rt_device *dev, rt_base_t pin, rt_base_t valu { GPIO_REG_GPCLR1(GPIO_BASE) = 1 << (pin % 32); } - + } } diff --git a/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.h b/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.h index c4658fcebb..3627b51593 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.h +++ b/bsp/raspberry-pi/raspi4-64/driver/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/raspberry-pi/raspi4-64/driver/drv_uart.c b/bsp/raspberry-pi/raspi4-64/driver/drv_uart.c index 6a70cdfb3a..597682df34 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/drv_uart.c +++ b/bsp/raspberry-pi/raspi4-64/driver/drv_uart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -117,7 +117,7 @@ static const struct rt_uart_ops _uart_ops = static void rt_hw_uart_isr(int irqno, void *param) { - struct rt_serial_device *serial = (struct rt_serial_device*)param; + struct rt_serial_device *serial = (struct rt_serial_device*)param; rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); PL011_REG_ICR(UART0_BASE) = PL011_INTERRUPT_RECEIVE; } diff --git a/bsp/raspberry-pi/raspi4-64/driver/drv_uart.h b/bsp/raspberry-pi/raspi4-64/driver/drv_uart.h index 714043efd3..1dfb9b7e04 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/drv_uart.h +++ b/bsp/raspberry-pi/raspi4-64/driver/drv_uart.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 *