[raspi] auto formatted

This commit is contained in:
Meco Man 2021-03-14 12:58:10 +08:00
parent c3ffe18688
commit 1af9bbce32
103 changed files with 325 additions and 325 deletions

View File

@ -3,8 +3,8 @@
#include <rthw.h> #include <rthw.h>
#define PER_BASE (0x3F000000) #define PER_BASE (0x3F000000)
#define PER_BASE_40000000 (0x40000000) #define PER_BASE_40000000 (0x40000000)
/* /*
* GPIO * GPIO
@ -50,17 +50,17 @@
/* /*
* ARM Timer * 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_LOAD HWREG32(ARM_TIMER_BASE + 0x400)
#define ARM_TIMER_VALUE HWREG32(ARM_TIMER_BASE + 0x404) #define ARM_TIMER_VALUE HWREG32(ARM_TIMER_BASE + 0x404)
#define ARM_TIMER_CTRL HWREG32(ARM_TIMER_BASE + 0x408) #define ARM_TIMER_CTRL HWREG32(ARM_TIMER_BASE + 0x408)
#define ARM_TIMER_IRQCLR HWREG32(ARM_TIMER_BASE + 0x40C) #define ARM_TIMER_IRQCLR HWREG32(ARM_TIMER_BASE + 0x40C)
#define ARM_TIMER_RAWIRQ HWREG32(ARM_TIMER_BASE + 0x410) #define ARM_TIMER_RAWIRQ HWREG32(ARM_TIMER_BASE + 0x410)
#define ARM_TIMER_MASKIRQ HWREG32(ARM_TIMER_BASE + 0x414) #define ARM_TIMER_MASKIRQ HWREG32(ARM_TIMER_BASE + 0x414)
#define ARM_TIMER_RELOAD HWREG32(ARM_TIMER_BASE + 0x418) #define ARM_TIMER_RELOAD HWREG32(ARM_TIMER_BASE + 0x418)
#define ARM_TIMER_PREDIV HWREG32(ARM_TIMER_BASE + 0x41C) #define ARM_TIMER_PREDIV HWREG32(ARM_TIMER_BASE + 0x41C)
#define ARM_TIMER_CNTR HWREG32(ARM_TIMER_BASE + 0x420) #define ARM_TIMER_CNTR HWREG32(ARM_TIMER_BASE + 0x420)
/* /*
* Core Timer * Core Timer

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : test_driver.h * 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 * SPDX-License-Identifier: Apache-2.0
* *
@ -50,7 +50,7 @@ void test_hdmi()
int i=0; int i=0;
for (; i < 20; i++) colors[i] = COLOR_RED; for (; i < 20; i++) colors[i] = COLOR_RED;
rt_graphix_ops(hdmi) -> blit_line((char *)colors, 20, 20, 20); rt_graphix_ops(hdmi) -> blit_line((char *)colors, 20, 20, 20);
#endif #endif
} }
@ -73,8 +73,8 @@ void test_cpusmp(void)
{ {
rt_kprintf("Hello Test SMP!\n"); rt_kprintf("Hello Test SMP!\n");
#ifdef RT_USING_SMP #ifdef RT_USING_SMP
int i; int i;
char test_name[RT_NAME_MAX]; char test_name[RT_NAME_MAX];
for (i = 0; i < _CPUS_NR; i++) for (i = 0; i < _CPUS_NR; i++)
{ {
rt_sprintf(test_name, "smp%d", 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); rt_kprintf("can't find %s device!\n", name);
else else
{ {
read_regs(i2c_bus, 7, buf); read_regs(i2c_bus, 7, buf);
buf[0] = buf[0]&0x7F; //sec buf[0] = buf[0]&0x7F; //sec
buf[1] = buf[1]&0x7F; //min buf[1] = buf[1]&0x7F; //min
buf[2] = buf[2]&0x3F; //hour buf[2] = buf[2]&0x3F; //hour
buf[3] = buf[3]&0x07; //week buf[3] = buf[3]&0x07; //week
buf[4] = buf[4]&0x3F; //day buf[4] = buf[4]&0x3F; //day
buf[5] = buf[5]&0x1F; //mouth buf[5] = buf[5]&0x1F; //mouth
//year/month/day //year/month/day
rt_kprintf("20%02x-%02x-%02x ",buf[6],buf[5],buf[4]); rt_kprintf("20%02x-%02x-%02x ",buf[6],buf[5],buf[4]);
//hour:minute/second //hour:minute/second
rt_kprintf("%02x:%02x:%02x \n",buf[2],buf[1],buf[0]); rt_kprintf("%02x:%02x:%02x \n",buf[2],buf[1],buf[0]);
} }
#endif #endif
} }

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) 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) 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) static inline void enable_cpu_timer_intr(int cpu)
{ {
CORETIMER_INTCTL(cpu) = 0x8; CORETIMER_INTCTL(cpu) = 0x8;
} }
static inline void enable_cntv(void) static inline void enable_cntv(void)

View File

@ -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 * 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) : "r" (&lock->slock), "I" (1 << 16)
: "cc"); : "cc");
while (lockval.tickets.next != lockval.tickets.owner) while (lockval.tickets.next != lockval.tickets.owner)
{ {
__WFE(); __WFE();
lockval.tickets.owner = *(volatile unsigned short *)(&lock->tickets.owner); lockval.tickets.owner = *(volatile unsigned short *)(&lock->tickets.owner);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -7,7 +7,7 @@
* Date Author Notes * Date Author Notes
* 2018/5/3 Bernard first version * 2018/5/3 Bernard first version
* 2019-07-28 zdzn add smp support * 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 * 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) if (cpu_mask & 0x2)
{ {
send_ipi_msg(1, ipi_vector); send_ipi_msg(1, ipi_vector);
} }
if (cpu_mask & 0x4) if (cpu_mask & 0x4)
{ {
send_ipi_msg(2, ipi_vector); send_ipi_msg(2, ipi_vector);
} }
if (cpu_mask & 0x8) if (cpu_mask & 0x8)
{ {
send_ipi_msg(3, ipi_vector); send_ipi_msg(3, ipi_vector);
} }
__DSB(); __DSB();
} }

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -43,7 +43,7 @@
/* normal memory mapping type */ /* normal memory mapping type */
#define NORMAL_MEM (SHARED | AP_RW | DOMAIN0 | MEMWBWA | DESC_SEC) #define NORMAL_MEM (SHARED | AP_RW | DOMAIN0 | MEMWBWA | DESC_SEC)
#define STRONG_ORDER_MEM (SHARED | AP_RO | XN | 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, void rt_hw_change_mmu_table(rt_uint32_t vaddrStart,
rt_uint32_t size, rt_uint32_t size,

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -7,7 +7,7 @@
* Date Author Notes * Date Author Notes
* 2013-07-20 Bernard first version * 2013-07-20 Bernard first version
* 2019-07-28 zdzn add smp support * 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 * 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) if (mailbox_data & 0x1)
{ {
/* clear mailbox */ /* clear mailbox */
IPI_MAILBOX_CLEAR(cpu_id) = mailbox_data; IPI_MAILBOX_CLEAR(cpu_id) = mailbox_data;
isr_func = isr_table[IRQ_ARM_MAILBOX].handler; isr_func = isr_table[IRQ_ARM_MAILBOX].handler;
#ifdef RT_USING_INTERRUPT_INFO #ifdef RT_USING_INTERRUPT_INFO
isr_table[IRQ_ARM_MAILBOX].counter++; isr_table[IRQ_ARM_MAILBOX].counter++;
@ -175,7 +175,7 @@ void rt_hw_trap_irq(void)
isr_func(IRQ_ARM_MAILBOX, param); isr_func(IRQ_ARM_MAILBOX, param);
} }
} }
else else
CORE_MAILBOX3_CLEAR(cpu_id) = mailbox_data; CORE_MAILBOX3_CLEAR(cpu_id) = mailbox_data;
} }
#endif #endif

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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; return RT_EOK;
} }
const static struct rt_device_ops hdmi_fb_ops = const static struct rt_device_ops hdmi_fb_ops =
{ {
RT_NULL, RT_NULL,
hdmi_fb_open, 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_set_pixel,
hdmi_get_pixel, hdmi_get_pixel,

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -14,15 +14,15 @@
#define COLOR_BLACK RGB(0, 0, 0) #define COLOR_BLACK RGB(0, 0, 0)
#define COLOR_GREEN RGB(0, 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_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_WHITE COLOR_WHITE
#define CONSOLE_BLACK COLOR_BLACK #define CONSOLE_BLACK COLOR_BLACK

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : drv_sdio.c * 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 * 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) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK)
{ {
return -RT_ERROR; return -RT_ERROR;
} }
return RT_EOK; return RT_EOK;
} }

View File

@ -1,6 +1,6 @@
/* /*
* File : drv_sdio.h * 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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) if (mode == HWTIMER_MODE_PERIOD)
timer->cnt = cnt; timer->cnt = cnt;
else else
timer->cnt = 0; timer->cnt = 0;
__sync_synchronize(); __sync_synchronize();
if (timer_id == 1) if (timer_id == 1)
{ {
rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1); rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1);
STIMER_C1 = STIMER_CLO + cnt; STIMER_C1 = STIMER_CLO + cnt;
} }
else if (timer_id == 3) else if (timer_id == 3)
{ {
rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3); rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3);
STIMER_C3 = STIMER_CLO + cnt; STIMER_C3 = STIMER_CLO + cnt;
} }
else else
result = -RT_ERROR; result = -RT_ERROR;
__sync_synchronize(); __sync_synchronize();
return result; return result;
} }
@ -56,7 +56,7 @@ static void raspi_systimer_stop(rt_hwtimer_t *hwtimer)
rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1); rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1);
else if (timer_id == 3) else if (timer_id == 3)
rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_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) 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) void rt_device_systimer_isr(int vector, void *param)
{ {
rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param; rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param;
rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data; rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data;
RT_ASSERT(timer != RT_NULL); RT_ASSERT(timer != RT_NULL);
@ -86,18 +86,18 @@ void rt_device_systimer_isr(int vector, void *param)
if (timer_id == 1) if (timer_id == 1)
{ {
STIMER_CS = 0x2; STIMER_CS = 0x2;
STIMER_C1 = STIMER_CLO + timer->cnt; STIMER_C1 = STIMER_CLO + timer->cnt;
} }
else if (timer_id == 3) else if (timer_id == 3)
{ {
STIMER_CS = 0x8; STIMER_CS = 0x8;
STIMER_C3 = STIMER_CLO + timer->cnt; STIMER_C3 = STIMER_CLO + timer->cnt;
} }
__sync_synchronize(); __sync_synchronize();
rt_device_hwtimer_isr(hwtimer); rt_device_hwtimer_isr(hwtimer);
} }
static struct rt_hwtimer_device _hwtimer1; static struct rt_hwtimer_device _hwtimer1;
static struct rt_hwtimer_device _hwtimer3; static struct rt_hwtimer_device _hwtimer3;

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) 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); rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
} }

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -129,9 +129,9 @@ int reboot(void)
PM_RSTS = PM_PASSWORD | r; // boot from partition 0 PM_RSTS = PM_PASSWORD | r; // boot from partition 0
PM_WDOG = PM_PASSWORD | 10; PM_WDOG = PM_PASSWORD | 10;
PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET; PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
while (1); while (1);
return 0; return 0;
} }
MSH_CMD_EXPORT(reboot,reboot system...); MSH_CMD_EXPORT(reboot,reboot system...);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : mbox.c * 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 * SPDX-License-Identifier: Apache-2.0
* *
@ -41,7 +41,7 @@ int mbox_call(unsigned char ch, int mmu_enable)
do do
{ {
asm volatile("nop"); asm volatile("nop");
} }
while (*MBOX_STATUS & MBOX_EMPTY); while (*MBOX_STATUS & MBOX_EMPTY);
/* is it a response to our message? */ /* is it a response to our message? */
if (r == *MBOX_READ) if (r == *MBOX_READ)

View File

@ -1,6 +1,6 @@
/* /*
* File : mbox.h * 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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : rsapi.h * 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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -16,10 +16,10 @@
void set_led(int state) //set state LED nyala atau mati void set_led(int state) //set state LED nyala atau mati
{ {
if (state==1) //LED nyala if (state==1) //LED nyala
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = 0x00038041; // get serial number command mbox[2] = 0x00038041; // get serial number command
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 0; mbox[4] = 0;
@ -29,10 +29,10 @@ void set_led(int state) //set state LED nyala atau mati
mbox_call(8, MMU_DISABLE); mbox_call(8, MMU_DISABLE);
} }
else if (state==0) //LED mati else if (state==0) //LED mati
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = 0x00038041; // get serial number command mbox[2] = 0x00038041; // get serial number command
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 0; mbox[4] = 0;

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -62,7 +62,7 @@ void rt_hw_timer_init(void)
timerStep = rt_hw_get_gtimer_frq(); timerStep = rt_hw_get_gtimer_frq();
__DSB(); __DSB();
timerStep /= RT_TICK_PER_SECOND; timerStep /= RT_TICK_PER_SECOND;
rt_hw_gtimer_enable(); rt_hw_gtimer_enable();
rt_hw_set_gtimer_val(timerStep); rt_hw_set_gtimer_val(timerStep);
core0_timer_enable_interrupt_controller(); 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. * after interrupt disabled.
*/ */
void rt_hw_board_init(void) 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(0x3f804000, 0x3f804000, 0x1000, MEM_ATTR_IO);//i2c0
armv8_map(0x3f205000, 0x3f205000, 0x1000, MEM_ATTR_IO);//i2c1 armv8_map(0x3f205000, 0x3f205000, 0x1000, MEM_ATTR_IO);//i2c1
mmu_enable(); mmu_enable();
/* initialize hardware interrupt */ /* initialize hardware interrupt */
rt_hw_interrupt_init(); // in libcpu/interrupt.c. Set some data structures, no operation on device 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); rt_hw_vector_init(); // in libcpu/interrupt.c. == rt_cpu_vector_set_base((rt_ubase_t)&system_vectors);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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; return RT_EOK;
} }
const static struct rt_device_ops hdmi_fb_ops = const static struct rt_device_ops hdmi_fb_ops =
{ {
RT_NULL, RT_NULL,
hdmi_fb_open, 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT; mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_GET_PITCH; mbox[2] = MBOX_TAG_FB_GET_PITCH;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER; mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET; mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len mbox[4] = 8; // len
@ -225,7 +225,7 @@ void bcm283x_mbox_fb_setalpha(int alpha)
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE; mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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); volatile rt_base_t base = (volatile rt_base_t)(bus->parent.user_data);
if (bus->addr == 0) if (bus->addr == 0)
base = BCM283X_BSC0_BASE; base = BCM283X_BSC0_BASE;
else else
base = BCM283X_BSC1_BASE; base = BCM283X_BSC1_BASE;

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : drv_sdio.c * 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 * 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) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK)
{ {
return -RT_ERROR; return -RT_ERROR;
} }
return RT_EOK; return RT_EOK;
} }

View File

@ -1,6 +1,6 @@
/* /*
* File : drv_sdio.h * 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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) if (mode == HWTIMER_MODE_PERIOD)
timer->cnt = cnt; timer->cnt = cnt;
else else
timer->cnt = 0; timer->cnt = 0;
__sync_synchronize(); __sync_synchronize();
if (timer_id == 1) if (timer_id == 1)
{ {
rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1); rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_1);
STIMER_C1 = STIMER_CLO + cnt; STIMER_C1 = STIMER_CLO + cnt;
} }
else if (timer_id == 3) else if (timer_id == 3)
{ {
rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3); rt_hw_interrupt_umask(IRQ_SYSTEM_TIMER_3);
STIMER_C3 = STIMER_CLO + cnt; STIMER_C3 = STIMER_CLO + cnt;
} }
else else
result = -RT_ERROR; result = -RT_ERROR;
__sync_synchronize(); __sync_synchronize();
return result; return result;
} }
@ -58,7 +58,7 @@ static void raspi_systimer_stop(rt_hwtimer_t *hwtimer)
rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1); rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_1);
else if (timer_id == 3) else if (timer_id == 3)
rt_hw_interrupt_mask(IRQ_SYSTEM_TIMER_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) 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) void rt_device_systimer_isr(int vector, void *param)
{ {
rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param; rt_hwtimer_t *hwtimer = (rt_hwtimer_t *) param;
rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data; rt_systimer_t *timer = (rt_systimer_t *)hwtimer->parent.user_data;
RT_ASSERT(timer != RT_NULL); RT_ASSERT(timer != RT_NULL);
@ -88,12 +88,12 @@ void rt_device_systimer_isr(int vector, void *param)
if (timer_id == 1) if (timer_id == 1)
{ {
STIMER_CS = 0x2; STIMER_CS = 0x2;
STIMER_C1 = STIMER_CLO + timer->cnt; STIMER_C1 = STIMER_CLO + timer->cnt;
} }
else if (timer_id == 3) else if (timer_id == 3)
{ {
STIMER_CS = 0x8; STIMER_CS = 0x8;
STIMER_C3 = STIMER_CLO + timer->cnt; STIMER_C3 = STIMER_CLO + timer->cnt;
} }
__sync_synchronize(); __sync_synchronize();

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) 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); rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
} }

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -130,9 +130,9 @@ int reboot(void)
PM_RSTS = PM_PASSWORD | r; // boot from partition 0 PM_RSTS = PM_PASSWORD | r; // boot from partition 0
PM_WDOG = PM_PASSWORD | 10; PM_WDOG = PM_PASSWORD | 10;
PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET; PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
while (1); while (1);
return 0; return 0;
} }
MSH_CMD_EXPORT(reboot,reboot system...); MSH_CMD_EXPORT(reboot,reboot system...);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : mbox.c * 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 * 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? */ /* is it a response to our message? */
if (r == *MBOX_READ){ if (r == *MBOX_READ){
/* is it a valid successful response? */ /* 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; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL; mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 4; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 6; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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]; *base = mbox[5];
*size = mbox[6]; *size = mbox[6];
return 0; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY; mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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]; *base = mbox[5];
*size = mbox[6]; *size = mbox[6];
return 0; return 0;
} }
@ -177,8 +177,8 @@ int bcm283x_mbox_clock_get_turbo(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_GET_STATE; mbox[2] = MBOX_TAG_CLOCK_GET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_SET_STATE; mbox[2] = MBOX_TAG_CLOCK_SET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[2] = MBOX_TAG_CLOCK_SET_RATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE; mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_POWER_GET_STATE; mbox[2] = MBOX_TAG_POWER_GET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_POWER_SET_STATE; mbox[2] = MBOX_TAG_POWER_SET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len mbox[4] = 8; // len
@ -407,7 +407,7 @@ int bcm283x_mbox_temp_get(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_TEMP_GET; mbox[2] = MBOX_TAG_TEMP_GET;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len
@ -430,7 +430,7 @@ int bcm283x_mbox_temp_get_max(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_TEMP_GET_MAX; mbox[2] = MBOX_TAG_TEMP_GET_MAX;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len

View File

@ -1,6 +1,6 @@
/* /*
* File : mbox.h * 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 * SPDX-License-Identifier: Apache-2.0
* *
@ -32,7 +32,7 @@ extern volatile unsigned int* mbox;
/* tags */ /* tags */
#define MBOX_TAG_SETPOWER 0x28001 #define MBOX_TAG_SETPOWER 0x28001
#define MBOX_TAG_SETCLKRATE 0x38002 #define MBOX_TAG_SETCLKRATE 0x38002
#define MBOX_GET_MAC_ADDRESS 0x10003 #define MBOX_GET_MAC_ADDRESS 0x10003
#define MBOX_TAG_LAST 0 #define MBOX_TAG_LAST 0
#define MMIO_BASE 0x3F000000 #define MMIO_BASE 0x3F000000
@ -47,12 +47,12 @@ extern volatile unsigned int* mbox;
#define MBOX_FULL 0x80000000 #define MBOX_FULL 0x80000000
#define MBOX_EMPTY 0x40000000 #define MBOX_EMPTY 0x40000000
#define DEVICE_ID_SD_CARD 0 #define DEVICE_ID_SD_CARD 0
#define DEVICE_ID_USB_HCD 3 #define DEVICE_ID_USB_HCD 3
#define POWER_STATE_OFF (0 << 0) #define POWER_STATE_OFF (0 << 0)
#define POWER_STATE_ON (1 << 0) #define POWER_STATE_ON (1 << 0)
#define POWER_STATE_WAIT (1 << 1) #define POWER_STATE_WAIT (1 << 1)
#define POWER_STATE_NO_DEVICE (1 << 1) // in response #define POWER_STATE_NO_DEVICE (1 << 1) // in response
#define MMU_ENABLE 1 #define MMU_ENABLE 1
#define MMU_DISABLE 0 #define MMU_DISABLE 0

View File

@ -1,6 +1,6 @@
/* /*
* File : rsapi.h * 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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -17,7 +17,7 @@
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
rt_kprintf("Hi, this is RT-Thread!!\n"); rt_kprintf("Hi, this is RT-Thread!!\n");
rt_pin_mode(ACTLED, PIN_MODE_OUTPUT); rt_pin_mode(ACTLED, PIN_MODE_OUTPUT);
while(1) while(1)

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -22,7 +22,7 @@ struct mem_desc platform_mem_desc[] = {
{0x0, 0x6400000, 0x0, NORMAL_MEM}, {0x0, 0x6400000, 0x0, NORMAL_MEM},
{0x8000000, 0x8800000, 0x8000000, DEVICE_MEM}, //mbox msg {0x8000000, 0x8800000, 0x8000000, DEVICE_MEM}, //mbox msg
{0x0E000000, 0x0EE00000, 0x0E000000, DEVICE_MEM}, //framebuffer {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 {0xFD500000, 0xFDA00000, 0xFD500000, DEVICE_MEM}, //gmac
{0xFE000000, 0xFF000000, 0xFE000000, DEVICE_MEM}, //peripheral {0xFE000000, 0xFF000000, 0xFE000000, DEVICE_MEM}, //peripheral
{0xFF800000, 0xFFA00000, 0xFF800000, DEVICE_MEM} //gic {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. * after interrupt disabled.
*/ */
void rt_hw_board_init(void) void rt_hw_board_init(void)

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) int rt_hw_eth_init(void)
{ {
rt_uint8_t mac_addr[6]; rt_uint8_t mac_addr[6];
rt_sem_init(&sem_lock, "eth_lock", 1, RT_IPC_FLAG_FIFO); rt_sem_init(&sem_lock, "eth_lock", 1, RT_IPC_FLAG_FIFO);
rt_sem_init(&link_ack, "link_ack", 0, RT_IPC_FLAG_FIFO); rt_sem_init(&link_ack, "link_ack", 0, RT_IPC_FLAG_FIFO);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -102,7 +102,7 @@ static void gpio_set_pud(GPIO_PIN pin, GPIO_PUPD_FUNC mode)
case 3: case 3:
reg_value = GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE); reg_value = GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE);
GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE) = (reg_value | (mode << (fselrest*2))); GPIO_PUP_PDN_CNTRL_REG3(GPIO_BASE) = (reg_value | (mode << (fselrest*2)));
break; break;
default: default:
break; break;
} }
@ -194,7 +194,7 @@ static int raspi_pin_read(struct rt_device *device, rt_base_t pin)
else else
{ {
pin_level = 0; pin_level = 0;
} }
} }
else else
@ -422,7 +422,7 @@ int rt_hw_gpio_init(void)
GPIO_REG_GPAFEN0(GPIO_BASE) = 0x0; GPIO_REG_GPAFEN0(GPIO_BASE) = 0x0;
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_install(IRQ_GPIO0, gpio_irq_handler, &_g_gpio_irq_tbl[0], "gpio0_irq");
rt_hw_interrupt_umask(IRQ_GPIO0); rt_hw_interrupt_umask(IRQ_GPIO0);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -16,7 +16,7 @@
/* /*
* (3.3v) -1 2- * (3.3v) -1 2-
* (SDA1/SDA3) -3 4- * (SDA1/SDA3) -3 4-
* (SCL1/SCL3) -5 6- * (SCL1/SCL3) -5 6-
* (SDA3) -7 8- * (SDA3) -7 8-
* -9 10- * -9 10-
* -11 12- * -11 12-
@ -268,7 +268,7 @@ static struct raspi_i2c_hw_config hw_device4 =
.scl_pin = GPIO_PIN_7, .scl_pin = GPIO_PIN_7,
#else #else
.sda_pin = GPIO_PIN_8, .sda_pin = GPIO_PIN_8,
.scl_pin = GPIO_PIN_9, .scl_pin = GPIO_PIN_9,
#endif #endif
.sda_mode = ALT5, .sda_mode = ALT5,
.scl_mode = ALT5, .scl_mode = ALT5,

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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) else if (read32(pdat->virt + EMMC_INTERRUPT) & INT_ERROR_MASK)
{ {
return -RT_ERROR; return -RT_ERROR;
} }
return RT_EOK; 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; sdHostVer = (temp & HOST_SPEC_NUM) >> HOST_SPEC_NUM_SHIFT;
int cdiv = sd_get_clock_divider(sdHostVer, mmc_base_clock, clock); int cdiv = sd_get_clock_divider(sdHostVer, mmc_base_clock, clock);
temp = read32((pdat->virt + EMMC_CONTROL1)); temp = read32((pdat->virt + EMMC_CONTROL1));
temp |= 1; temp |= 1;
temp |= cdiv; temp |= cdiv;
temp |= (7 << 16); temp |= (7 << 16);
@ -639,7 +639,7 @@ int raspi_sdmmc_init(void)
#endif #endif
mmcsd_change(host); mmcsd_change(host);
#endif #endif
return RT_EOK; return RT_EOK;
err: err:
if (host) rt_free(host); if (host) rt_free(host);
if (sdhci) rt_free(sdhci); if (sdhci) rt_free(sdhci);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -85,7 +85,7 @@ struct sdhci_t
rt_uint32_t width; rt_uint32_t width;
rt_uint32_t clock; rt_uint32_t clock;
rt_err_t removeable; rt_err_t removeable;
void * sdcard; void * sdcard;
rt_err_t (*detect)(struct sdhci_t * sdhci); rt_err_t (*detect)(struct sdhci_t * sdhci);
rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width); rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width);

View File

@ -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 * 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) 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 else
{ {
SPI_REG_CS(hwcfg->hw_base) &= ~SPI_CS_CSPOL_HIGH; SPI_REG_CS(hwcfg->hw_base) &= ~SPI_CS_CSPOL_HIGH;
} }
return RT_EOK; 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) if (config.mode & RT_SPI_MSB)
{ {
flag = 1; flag = 1;
} }
else else
{ {
flag = 0; 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)); SPI_REG_CLK(hwcfg->hw_base) = (RPI_CORE_CLK_HZ / (config.max_hz));
} }
//cs_pin spi0.0 //cs_pin spi0.0
if(cs_pin == GPIO_PIN_8) if(cs_pin == GPIO_PIN_8)
{ {

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -70,7 +70,7 @@ struct raspi_spi_hw_config
GPIO_FUNC ce2_mode; GPIO_FUNC ce2_mode;
#endif #endif
rt_ubase_t hw_base; rt_ubase_t hw_base;
}; };
struct raspi_spi_device struct raspi_spi_device

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -211,7 +211,7 @@ static const struct rt_uart_ops _uart_ops =
#ifdef RT_USING_UART1 #ifdef RT_USING_UART1
static void rt_hw_aux_uart_isr(int irqno, void *param) 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); rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
} }
#endif #endif
@ -220,7 +220,7 @@ static void rt_hw_uart_isr(int irqno, void *param)
{ {
#ifdef RT_USING_UART0 #ifdef RT_USING_UART0
if((PACTL_CS & IRQ_UART0) == IRQ_UART0) if((PACTL_CS & IRQ_UART0) == IRQ_UART0)
{ {
PACTL_CS &= ~(IRQ_UART0); PACTL_CS &= ~(IRQ_UART0);
rt_hw_serial_isr(&_serial0, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&_serial0, RT_SERIAL_EVENT_RX_IND);
PL011_REG_ICR(UART0_BASE) = PL011_INTERRUPT_RECEIVE; PL011_REG_ICR(UART0_BASE) = PL011_INTERRUPT_RECEIVE;

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -128,7 +128,7 @@ void reboot(void)
PM_RSTS |= (PM_PASSWORD | r); // boot from partition 0 PM_RSTS |= (PM_PASSWORD | r); // boot from partition 0
PM_WDOG |= (PM_PASSWORD | 0x0A); PM_WDOG |= (PM_PASSWORD | 0x0A);
PM_RSTC |= (PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET); PM_RSTC |= (PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET);
while (1); while (1);
} }
MSH_CMD_EXPORT(reboot,reboot system...); MSH_CMD_EXPORT(reboot,reboot system...);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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 #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, RT_NULL,
hdmi_fb_open, 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT; mbox[2] = MBOX_TAG_FB_GET_GPIOVIRT;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_GET_PITCH; mbox[2] = MBOX_TAG_FB_GET_PITCH;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER; mbox[2] = MBOX_TAG_FB_SET_PIXEL_ORDER;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET; mbox[2] = MBOX_TAG_FB_SET_VIRT_OFFSET;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len mbox[4] = 8; // len
@ -233,7 +233,7 @@ void bcm271x_mbox_fb_setalpha(int alpha)
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE; mbox[2] = MBOX_TAG_FB_SET_ALPHA_MODE;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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*/ /*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); writeCommand(lcd_dev, 0x36);
rt_thread_mdelay(100); rt_thread_mdelay(100);
@ -134,7 +134,7 @@ static inline void lcd_set_rotation(uint8_t rotation)
lcd_write_data(0x01); lcd_write_data(0x01);
lcd_write_data(0xE0); lcd_write_data(0xE0);
} }
if((rotation == SCREEN_HORIZONTAL_1) || (rotation == SCREEN_HORIZONTAL_2)) if((rotation == SCREEN_HORIZONTAL_1) || (rotation == SCREEN_HORIZONTAL_2))
{ {
lcd_write_commmand(0x2B); lcd_write_commmand(0x2B);
@ -177,7 +177,7 @@ static inline void fast_send_data(void)
rt_sem_release(&lcd_spi_lock); rt_sem_release(&lcd_spi_lock);
} }
static inline void lcd_show(void) static inline void lcd_show(void)
{ {
lcd_write_commmand(0x2C); // Memory write? lcd_write_commmand(0x2C); // Memory write?
@ -188,11 +188,11 @@ static inline void lcd_show(void)
fast_send_data(); fast_send_data();
#else #else
int i, j; 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]; uint16_t *tx_data = (uint16_t*)&send_buffer[5120* i];
int32_t data_sz = 5120; int32_t data_sz = 5120;
for( j=0; j<data_sz; j++) for( j=0; j<data_sz; j++)
{ {
writeData16(tx_data[j]); writeData16(tx_data[j]);
} }
@ -331,7 +331,7 @@ rt_err_t ili9486_control(rt_device_t dev, int cmd, void *args)
} }
#ifdef RT_USING_DEVICE_OPS #ifdef RT_USING_DEVICE_OPS
const static struct rt_device_ops ili9486_ops = const static struct rt_device_ops ili9486_ops =
{ {
RT_NULL, RT_NULL,
ili9486_open, ili9486_open,

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -55,7 +55,7 @@ static void newline(fb_t* fb)
if(fb->depth >= 3) if(fb->depth >= 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++) for (i = 0; i < (CHAR_H * fb->width); i++)
{ {
@ -64,7 +64,7 @@ static void newline(fb_t* fb)
} }
else 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++) 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; *((unsigned short*) (addr + line)) = ((int) *(glyph + ((i)/8)) * 1) & mask ? fb->fore : fb->back;
} }
mask >>= 1; mask >>= 1;
if(mask == 0) if(mask == 0)
{ {
@ -170,12 +170,12 @@ void fb_print(char *s)
{ {
rt_device_control(console_dev,RTGRAPHIC_CTRL_RECT_UPDATE, RT_NULL); rt_device_control(console_dev,RTGRAPHIC_CTRL_RECT_UPDATE, RT_NULL);
} }
#endif #endif
} }
#ifndef LCD_CONSOLE_FLUSH_NOW #ifndef LCD_CONSOLE_FLUSH_NOW
void lcd_console_task_entry(void *param) void lcd_console_task_entry(void *param)
{ {
fb_t *fb = (fb_t *)param; fb_t *fb = (fb_t *)param;
while (1) while (1)
{ {
@ -186,7 +186,7 @@ void lcd_console_task_entry(void *param)
} }
rt_thread_mdelay(LCD_CONSOLE_DELAY); rt_thread_mdelay(LCD_CONSOLE_DELAY);
} }
} }
#endif #endif
@ -199,7 +199,7 @@ int lcd_console_init(void)
rt_kprintf("no console dev!\n"); rt_kprintf("no console dev!\n");
return 0; return 0;
} }
if(console_dev->ref_count >= 1) if(console_dev->ref_count >= 1)
{ {
rt_kprintf("lcd console has open!\n"); 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_open(console_dev,RT_DEVICE_OFLAG_RDWR);
rt_device_control(console_dev, RTGRAPHIC_CTRL_GET_INFO, &info); 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)); 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)); rt_memset(virt_buffer, 0 , info.width * info.height * (info.bits_per_pixel/8));
console_fb.width = info.width; console_fb.width = info.width;
@ -246,7 +246,7 @@ int lcd_console_init(void)
* #ifdef USING_LCD_CONSOLE * #ifdef USING_LCD_CONSOLE
* fb_print((char*)rt_log_buf); * fb_print((char*)rt_log_buf);
* #endif * #endif
* *
* remove rt_console_set_device(CONSOLE_NAME); * remove rt_console_set_device(CONSOLE_NAME);
*/ */
rt_console_set_device(CONSOLE_NAME); rt_console_set_device(CONSOLE_NAME);

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -15,10 +15,10 @@
#define RGB(r, g, b) ((((r))<<16) | (((g))<<8) | ((b))) #define RGB(r, g, b) ((((r))<<16) | (((g))<<8) | ((b)))
#define COLOR_BLACK RGB(0, 0, 0) #define COLOR_BLACK RGB(0, 0, 0)
#define COLOR_GREEN RGB(0, 255, 0) #define COLOR_GREEN RGB(0, 255, 0)
#define COLOR_CYAN RGB(0, 255, 255) #define COLOR_CYAN RGB(0, 255, 255)
#define COLOR_RED RGB(255, 0, 0) #define COLOR_RED RGB(255, 0, 0)
#define COLOR_YELLOW RGB(255, 255, 0) #define COLOR_YELLOW RGB(255, 255, 0)
#define COLOR_WHITE RGB(255, 255, 255) #define COLOR_WHITE RGB(255, 255, 255)
#define CONSOLE_WHITE_32 COLOR_WHITE #define CONSOLE_WHITE_32 COLOR_WHITE

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,6 +1,6 @@
/* /*
* File : mbox.c * 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 * SPDX-License-Identifier: Apache-2.0
* *
@ -15,7 +15,7 @@
#include "mmu.h" #include "mmu.h"
//volatile unsigned int __attribute__((aligned(16))) mbox[36]; //volatile unsigned int __attribute__((aligned(16))) mbox[36];
volatile unsigned int *mbox = (volatile unsigned int *) MBOX_ADDR; 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 * 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 4; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
@ -76,7 +76,7 @@ int bcm271x_notify_reboot(void)
mbox[4] = 0x00000000; // size of the data mbox[4] = 0x00000000; // size of the data
mbox[5] = 0x00000000; // request mbox[5] = 0x00000000; // request
mbox[6] = MBOX_TAG_LAST; mbox[6] = MBOX_TAG_LAST;
mbox_call(8, MMU_DISABLE); mbox_call(8, MMU_DISABLE);
return 0; return 0;
} }
@ -89,7 +89,7 @@ int bcm271x_notify_xhci_reset(void)
mbox[3] = 0x00000004; // length + 4 mbox[3] = 0x00000004; // length + 4
mbox[4] = 0x00000004; // size of the data mbox[4] = 0x00000004; // size of the data
mbox[5] = 0x00100000; // request mbox[5] = 0x00100000; // request
mbox[6] = MBOX_TAG_LAST; mbox[6] = MBOX_TAG_LAST;
mbox_call(8, MMU_DISABLE); mbox_call(8, MMU_DISABLE);
return 0; return 0;
} }
@ -98,7 +98,7 @@ int bcm271x_gpu_enable(void)
{ {
mbox[0] = 12*4; // length of the message mbox[0] = 12*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[2] = MBOX_TAG_CLOCK_SET_RATE;
mbox[3] = 0x00000008; // (the tag id) mbox[3] = 0x00000008; // (the tag id)
mbox[4] = 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL; mbox[2] = MBOX_TAG_HARDWARE_GET_MODEL;
mbox[3] = 4; // buffer size mbox[3] = 4; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 4; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 6; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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]; *base = mbox[5];
*size = mbox[6]; *size = mbox[6];
return 0; 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY; mbox[2] = MBOX_TAG_HARDWARE_GET_VC_MEMORY;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 0; // len mbox[4] = 0; // len
mbox[5] = 0; mbox[5] = 0;
mbox[6] = 0; mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST; 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]; *base = mbox[5];
*size = mbox[6]; *size = mbox[6];
return 0; return 0;
} }
@ -242,8 +242,8 @@ int bcm271x_mbox_clock_get_turbo(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_GET_STATE; mbox[2] = MBOX_TAG_CLOCK_GET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_SET_STATE; mbox[2] = MBOX_TAG_CLOCK_SET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_SET_RATE; mbox[2] = MBOX_TAG_CLOCK_SET_RATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE; mbox[2] = MBOX_TAG_CLOCK_GET_MAX_RATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request 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[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_POWER_GET_STATE; mbox[2] = MBOX_TAG_POWER_GET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len 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[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_POWER_SET_STATE; mbox[2] = MBOX_TAG_POWER_SET_STATE;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 8; // len mbox[4] = 8; // len
@ -472,7 +472,7 @@ int bcm271x_mbox_temp_get(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_TEMP_GET; mbox[2] = MBOX_TAG_TEMP_GET;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len
@ -495,7 +495,7 @@ int bcm271x_mbox_temp_get_max(void)
{ {
mbox[0] = 8*4; // length of the message mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message mbox[1] = MBOX_REQUEST; // this is a request message
mbox[2] = MBOX_TAG_TEMP_GET_MAX; mbox[2] = MBOX_TAG_TEMP_GET_MAX;
mbox[3] = 8; // buffer size mbox[3] = 8; // buffer size
mbox[4] = 4; // len mbox[4] = 4; // len

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -149,8 +149,8 @@ typedef enum {
} while (0) \ } while (0) \
//External Mass Media Controller (SD Card) //External Mass Media Controller (SD Card)
#define MMC0_BASE_ADDR (PER_BASE+0x300000) #define MMC0_BASE_ADDR (PER_BASE+0x300000)
#define MMC2_BASE_ADDR (PER_BASE+0x340000) #define MMC2_BASE_ADDR (PER_BASE+0x340000)
#define ETH_IRQ (160+29) #define ETH_IRQ (160+29)
@ -162,7 +162,7 @@ typedef enum {
#define BSC5_BASE_OFFSET (0x205A80) #define BSC5_BASE_OFFSET (0x205A80)
#define BSC6_BASE_OFFSET (0x205C00) #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. //HDMI interfaces and should not be accessed byuser programs.
#define BSC0_BASE (PER_BASE + BSC0_BASE_OFFSET) #define BSC0_BASE (PER_BASE + BSC0_BASE_OFFSET)
#define BSC1_BASE (PER_BASE + BSC1_BASE_OFFSET) #define BSC1_BASE (PER_BASE + BSC1_BASE_OFFSET)

View File

@ -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 * 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"); rt_kprintf("init dsi touch err!\n");
return; return;
} }
while (1) while (1)
{ {
struct touch_regs *regs = (struct touch_regs *)touchbuf; struct touch_regs *regs = (struct touch_regs *)touchbuf;
@ -73,7 +73,7 @@ static void dsi_touch_thread_entry(void *param)
{ {
touch_state = 0; touch_state = 0;
} }
rt_thread_mdelay(50); rt_thread_mdelay(50);
} }
} }

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -104,7 +104,7 @@ no pressed:(0x800,0xfff)
------------------------------------ ------------------------------------
*/ */
#define XMIN 0x800 #define XMIN 0x800
#define YMAX 0xfff #define YMAX 0xfff
void read_tp(void *dev, rt_uint16_t *x, rt_uint16_t *y) void read_tp(void *dev, rt_uint16_t *x, rt_uint16_t *y)
{ {
struct rt_spi_device *touch_dev = (struct rt_spi_device *)dev; struct rt_spi_device *touch_dev = (struct rt_spi_device *)dev;

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
@ -44,7 +44,7 @@ void rt_hw_timer_init(void)
timerStep = rt_hw_get_gtimer_frq(); timerStep = rt_hw_get_gtimer_frq();
__DSB(); __DSB();
timerStep /= RT_TICK_PER_SECOND; timerStep /= RT_TICK_PER_SECOND;
rt_hw_gtimer_enable(); rt_hw_gtimer_enable();
rt_hw_set_gtimer_val(timerStep); rt_hw_set_gtimer_val(timerStep);
core0_timer_enable_interrupt_controller(); 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. * after interrupt disabled.
*/ */
void rt_hw_board_init(void) void rt_hw_board_init(void)

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -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 * 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); GPIO_REG_GPCLR1(GPIO_BASE) = 1 << (pin % 32);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More