summaryrefslogtreecommitdiff
path: root/bsp/imx6sx
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-05-28 16:20:08 +0800
committerGitHub <[email protected]>2021-05-28 16:20:08 +0800
commit92beddf3bccf6346e26aa097f82464456fb8e6bd (patch)
tree197e4a108118dda016ea02274172f0c40e7ee8ed /bsp/imx6sx
parentb18a99b44240ec3152011e159cc24a5af8dff0ce (diff)
parent03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff)
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'bsp/imx6sx')
-rw-r--r--bsp/imx6sx/cortex-a9/applications/main.c2
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/cpu.c16
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/interrupt.c2
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/mmu.c2
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/pmu.c2
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/stack.c52
-rw-r--r--bsp/imx6sx/cortex-a9/cpu/trap.c2
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/board.c2
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/board.h2
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/emac_drv.c140
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/emac_drv.h2
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/serial.c2
-rw-r--r--bsp/imx6sx/cortex-a9/drivers/serial.h2
13 files changed, 114 insertions, 114 deletions
diff --git a/bsp/imx6sx/cortex-a9/applications/main.c b/bsp/imx6sx/cortex-a9/applications/main.c
index 9b0847fc8f..e32c9a1b4c 100644
--- a/bsp/imx6sx/cortex-a9/applications/main.c
+++ b/bsp/imx6sx/cortex-a9/applications/main.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/cpu/cpu.c b/bsp/imx6sx/cortex-a9/cpu/cpu.c
index 2d78715011..5f82671c1b 100644
--- a/bsp/imx6sx/cortex-a9/cpu/cpu.c
+++ b/bsp/imx6sx/cortex-a9/cpu/cpu.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -20,14 +20,14 @@
/** shutdown CPU */
void rt_hw_cpu_shutdown()
{
- rt_uint32_t level;
- rt_kprintf("shutdown...\n");
+ rt_uint32_t level;
+ rt_kprintf("shutdown...\n");
- level = rt_hw_interrupt_disable();
- while (level)
- {
- RT_ASSERT(0);
- }
+ level = rt_hw_interrupt_disable();
+ while (level)
+ {
+ RT_ASSERT(0);
+ }
}
/*@}*/
diff --git a/bsp/imx6sx/cortex-a9/cpu/interrupt.c b/bsp/imx6sx/cortex-a9/cpu/interrupt.c
index fb6e3ff3e0..1781ce49b7 100644
--- a/bsp/imx6sx/cortex-a9/cpu/interrupt.c
+++ b/bsp/imx6sx/cortex-a9/cpu/interrupt.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/cpu/mmu.c b/bsp/imx6sx/cortex-a9/cpu/mmu.c
index 58acdd8145..f4d6068099 100644
--- a/bsp/imx6sx/cortex-a9/cpu/mmu.c
+++ b/bsp/imx6sx/cortex-a9/cpu/mmu.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/cpu/pmu.c b/bsp/imx6sx/cortex-a9/cpu/pmu.c
index 8ffc1dede6..2b9165cc8b 100644
--- a/bsp/imx6sx/cortex-a9/cpu/pmu.c
+++ b/bsp/imx6sx/cortex-a9/cpu/pmu.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/cpu/stack.c b/bsp/imx6sx/cortex-a9/cpu/stack.c
index 2bd3c36915..e58852218a 100644
--- a/bsp/imx6sx/cortex-a9/cpu/stack.c
+++ b/bsp/imx6sx/cortex-a9/cpu/stack.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -28,35 +28,35 @@
* @return stack address
*/
rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
- rt_uint8_t *stack_addr, void *texit)
+ rt_uint8_t *stack_addr, void *texit)
{
- rt_uint32_t *stk;
+ rt_uint32_t *stk;
- stk = (rt_uint32_t*)stack_addr;
- *(stk) = (rt_uint32_t)tentry; /* entry point */
- *(--stk) = (rt_uint32_t)texit; /* lr */
- *(--stk) = 0; /* r12 */
- *(--stk) = 0; /* r11 */
- *(--stk) = 0; /* r10 */
- *(--stk) = 0; /* r9 */
- *(--stk) = 0; /* r8 */
- *(--stk) = 0; /* r7 */
- *(--stk) = 0; /* r6 */
- *(--stk) = 0; /* r5 */
- *(--stk) = 0; /* r4 */
- *(--stk) = 0; /* r3 */
- *(--stk) = 0; /* r2 */
- *(--stk) = 0; /* r1 */
- *(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
+ stk = (rt_uint32_t*)stack_addr;
+ *(stk) = (rt_uint32_t)tentry; /* entry point */
+ *(--stk) = (rt_uint32_t)texit; /* lr */
+ *(--stk) = 0; /* r12 */
+ *(--stk) = 0; /* r11 */
+ *(--stk) = 0; /* r10 */
+ *(--stk) = 0; /* r9 */
+ *(--stk) = 0; /* r8 */
+ *(--stk) = 0; /* r7 */
+ *(--stk) = 0; /* r6 */
+ *(--stk) = 0; /* r5 */
+ *(--stk) = 0; /* r4 */
+ *(--stk) = 0; /* r3 */
+ *(--stk) = 0; /* r2 */
+ *(--stk) = 0; /* r1 */
+ *(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
- /* cpsr */
- if ((rt_uint32_t)tentry & 0x01)
- *(--stk) = SVCMODE | 0x20; /* thumb mode */
- else
- *(--stk) = SVCMODE; /* arm mode */
+ /* cpsr */
+ if ((rt_uint32_t)tentry & 0x01)
+ *(--stk) = SVCMODE | 0x20; /* thumb mode */
+ else
+ *(--stk) = SVCMODE; /* arm mode */
- /* return task's current stack address */
- return (rt_uint8_t *)stk;
+ /* return task's current stack address */
+ return (rt_uint8_t *)stk;
}
/*@}*/
diff --git a/bsp/imx6sx/cortex-a9/cpu/trap.c b/bsp/imx6sx/cortex-a9/cpu/trap.c
index f3b2c26e6d..8393a27976 100644
--- a/bsp/imx6sx/cortex-a9/cpu/trap.c
+++ b/bsp/imx6sx/cortex-a9/cpu/trap.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/drivers/board.c b/bsp/imx6sx/cortex-a9/drivers/board.c
index 7ff9d47a89..92e8fa351e 100644
--- a/bsp/imx6sx/cortex-a9/drivers/board.c
+++ b/bsp/imx6sx/cortex-a9/drivers/board.c
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/drivers/board.h b/bsp/imx6sx/cortex-a9/drivers/board.h
index 9ae9ae60c7..f52ef4f08e 100644
--- a/bsp/imx6sx/cortex-a9/drivers/board.h
+++ b/bsp/imx6sx/cortex-a9/drivers/board.h
@@ -1,5 +1,5 @@
/*
- * 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/imx6sx/cortex-a9/drivers/emac_drv.c b/bsp/imx6sx/cortex-a9/drivers/emac_drv.c
index af5ca009cf..b51934eee1 100644
--- a/bsp/imx6sx/cortex-a9/drivers/emac_drv.c
+++ b/bsp/imx6sx/cortex-a9/drivers/emac_drv.c
@@ -1,6 +1,6 @@
/*
* COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* Change Logs:
* Date Author Notes
@@ -16,17 +16,17 @@
#include <lwipopts.h>
#include "emac_drv.h"
-#define MAX_ADDR_LEN 6
-#define IMX_EMAC_DEVICE(eth) (struct emac_device*)(eth)
+#define MAX_ADDR_LEN 6
+#define IMX_EMAC_DEVICE(eth) (struct emac_device*)(eth)
struct emac_device
{
- /* inherit from Ethernet device */
- struct eth_device parent;
+ /* inherit from Ethernet device */
+ struct eth_device parent;
- imx_enet_priv_t enet_priv;
- /* interface address info. */
- rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* MAC address */
+ imx_enet_priv_t enet_priv;
+ /* interface address info. */
+ rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* MAC address */
};
static struct emac_device _emac;
@@ -54,7 +54,7 @@ void init_enet(struct emac_device* emac)
// Check PHY link status.
if (!(emac->enet_priv.status & ENET_STATUS_LINK_ON))
{
- rt_kprintf("ENET link status check fail\n");
+ rt_kprintf("ENET link status check fail\n");
}
imx_enet_start(&emac->enet_priv, emac->dev_addr);
@@ -62,69 +62,69 @@ void init_enet(struct emac_device* emac)
void imx_enet_isr(int vector, void *param)
{
- unsigned int value = 0;
- imx_enet_priv_t * dev = &(_emac.enet_priv);
- volatile hw_enet_t *enet_reg = dev->enet_reg;
+ unsigned int value = 0;
+ imx_enet_priv_t * dev = &(_emac.enet_priv);
+ volatile hw_enet_t *enet_reg = dev->enet_reg;
value = enet_reg->EIR.U;
enet_reg->EIR.U = value & (~ENET_EVENT_MII);
if (value & ENET_EVENT_TX_ERR)
- {
+ {
dev->tx_busy = 0;
}
- else if (value & ENET_EVENT_TX)
- {
+ else if (value & ENET_EVENT_TX)
+ {
dev->tx_busy = 0;
}
if (value & ENET_EVENT_RX)
- {
- eth_device_ready(&(_emac.parent));
+ {
+ eth_device_ready(&(_emac.parent));
}
if (value & ENET_EVENT_HBERR)
- {
+ {
// printf("WARNGING[POLL]: Hearbeat error!\n");
}
if (value & ENET_EVENT_EBERR)
- {
+ {
// printf("WARNING[POLL]: Ethernet Bus Error!\n");
}
}
static rt_err_t imx_emac_init(rt_device_t dev)
{
- struct emac_device *emac;
+ struct emac_device *emac;
- emac = IMX_EMAC_DEVICE(dev);
+ emac = IMX_EMAC_DEVICE(dev);
- /* initialize enet */
- init_enet(emac);
- return RT_EOK;
+ /* initialize enet */
+ init_enet(emac);
+ return RT_EOK;
}
static rt_err_t imx_emac_open(rt_device_t dev, rt_uint16_t oflag)
{
- return RT_EOK;
+ return RT_EOK;
}
static rt_err_t imx_emac_close(rt_device_t dev)
{
- return RT_EOK;
+ return RT_EOK;
}
static rt_size_t imx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size)
{
- rt_set_errno(-RT_ENOSYS);
- return 0;
+ rt_set_errno(-RT_ENOSYS);
+ return 0;
}
static rt_size_t imx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size)
{
- rt_set_errno(-RT_ENOSYS);
- return 0;
+ rt_set_errno(-RT_ENOSYS);
+ return 0;
}
static rt_err_t imx_emac_control(rt_device_t dev, int cmd, void *args)
@@ -134,19 +134,19 @@ static rt_err_t imx_emac_control(rt_device_t dev, int cmd, void *args)
emac = IMX_EMAC_DEVICE(dev);
RT_ASSERT(emac != RT_NULL);
- switch(cmd)
- {
- case NIOCTL_GADDR:
- /* get MAC address */
- if(args) rt_memcpy(args, emac->dev_addr, 6);
- else return -RT_ERROR;
- break;
+ switch(cmd)
+ {
+ case NIOCTL_GADDR:
+ /* get MAC address */
+ if(args) rt_memcpy(args, emac->dev_addr, 6);
+ else return -RT_ERROR;
+ break;
- default :
- break;
- }
+ default :
+ break;
+ }
- return RT_EOK;
+ return RT_EOK;
}
/* Ethernet device interface */
@@ -161,8 +161,8 @@ rt_err_t imx_emac_tx(rt_device_t dev, struct pbuf* p)
/* copy pbuf to a whole ETH frame */
pbuf_copy_partial(p, s_pkt_send, p->tot_len, 0);
- /* send to the enet */
- imx_enet_send(&emac->enet_priv, s_pkt_send, p->tot_len, 1);
+ /* send to the enet */
+ imx_enet_send(&emac->enet_priv, s_pkt_send, p->tot_len, 1);
return result;
}
@@ -170,23 +170,23 @@ rt_err_t imx_emac_tx(rt_device_t dev, struct pbuf* p)
/* reception packet. */
struct pbuf *imx_emac_rx(rt_device_t dev)
{
- int len;
+ int len;
struct pbuf* p = RT_NULL;
struct emac_device *emac;
emac = IMX_EMAC_DEVICE(dev);
RT_ASSERT(emac != RT_NULL);
- imx_enet_recv(&emac->enet_priv, s_pkt_recv, &len);
- if (len > 0)
- {
- /* We allocate a pbuf chain of pbufs from the pool. */
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
- if (p != RT_NULL)
- {
- pbuf_take(p, s_pkt_recv, len);
- }
- }
+ imx_enet_recv(&emac->enet_priv, s_pkt_recv, &len);
+ if (len > 0)
+ {
+ /* We allocate a pbuf chain of pbufs from the pool. */
+ p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
+ if (p != RT_NULL)
+ {
+ pbuf_take(p, s_pkt_recv, len);
+ }
+ }
return p;
}
@@ -194,27 +194,27 @@ struct pbuf *imx_emac_rx(rt_device_t dev)
int imx_emac_hw_init(void)
{
/* test MAC address */
- _emac.dev_addr[0] = 0x00;
- _emac.dev_addr[1] = 0x11;
- _emac.dev_addr[2] = 0x22;
- _emac.dev_addr[3] = 0x33;
- _emac.dev_addr[4] = 0x44;
- _emac.dev_addr[5] = 0x55;
+ _emac.dev_addr[0] = 0x00;
+ _emac.dev_addr[1] = 0x11;
+ _emac.dev_addr[2] = 0x22;
+ _emac.dev_addr[3] = 0x33;
+ _emac.dev_addr[4] = 0x44;
+ _emac.dev_addr[5] = 0x55;
- _emac.parent.parent.init = imx_emac_init;
- _emac.parent.parent.open = imx_emac_open;
- _emac.parent.parent.close = imx_emac_close;
- _emac.parent.parent.read = imx_emac_read;
- _emac.parent.parent.write = imx_emac_write;
- _emac.parent.parent.control = imx_emac_control;
- _emac.parent.parent.user_data = RT_NULL;
+ _emac.parent.parent.init = imx_emac_init;
+ _emac.parent.parent.open = imx_emac_open;
+ _emac.parent.parent.close = imx_emac_close;
+ _emac.parent.parent.read = imx_emac_read;
+ _emac.parent.parent.write = imx_emac_write;
+ _emac.parent.parent.control = imx_emac_control;
+ _emac.parent.parent.user_data = RT_NULL;
- _emac.parent.eth_rx = imx_emac_rx;
- _emac.parent.eth_tx = imx_emac_tx;
+ _emac.parent.eth_rx = imx_emac_rx;
+ _emac.parent.eth_tx = imx_emac_tx;
/* register ETH device */
eth_device_init(&(_emac.parent), "e0");
- return 0;
+ return 0;
}
INIT_DEVICE_EXPORT(imx_emac_hw_init);
diff --git a/bsp/imx6sx/cortex-a9/drivers/emac_drv.h b/bsp/imx6sx/cortex-a9/drivers/emac_drv.h
index face875283..b87f7ef00d 100644
--- a/bsp/imx6sx/cortex-a9/drivers/emac_drv.h
+++ b/bsp/imx6sx/cortex-a9/drivers/emac_drv.h
@@ -1,6 +1,6 @@
/*
* COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* Change Logs:
* Date Author Notes
diff --git a/bsp/imx6sx/cortex-a9/drivers/serial.c b/bsp/imx6sx/cortex-a9/drivers/serial.c
index a2d4e2338a..df6e99e298 100644
--- a/bsp/imx6sx/cortex-a9/drivers/serial.c
+++ b/bsp/imx6sx/cortex-a9/drivers/serial.c
@@ -1,6 +1,6 @@
/*
* COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* Change Logs:
* Date Author Notes
diff --git a/bsp/imx6sx/cortex-a9/drivers/serial.h b/bsp/imx6sx/cortex-a9/drivers/serial.h
index 00d464bde0..69139bb75b 100644
--- a/bsp/imx6sx/cortex-a9/drivers/serial.h
+++ b/bsp/imx6sx/cortex-a9/drivers/serial.h
@@ -1,6 +1,6 @@
/*
* COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* Change Logs:
* Date Author Notes