[U-Boot] [PATCH 6/8] ls1021x: Update enabling lpuart with driver model
Bhuvanchandra DV
bhuvanchandra.dv at toradex.com
Tue Jan 12 05:28:07 CET 2016
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv at toradex.com>
---
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++++++++++++++
board/freescale/ls1021atwr/ls1021atwr.c | 15 ++++++++++++++-
include/configs/ls1021atwr.h | 1 +
3 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h
diff --git a/arch/arm/include/asm/arch-ls102xa/serial.h b/arch/arm/include/asm/arch-ls102xa/serial.h
new file mode 100644
index 0000000..8a99149
--- /dev/null
+++ b/arch/arm/include/asm/arch-ls102xa/serial.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2016 Toradex, Inc.
+ *
+ * Author: Bhuvanchandra DV <bhuvanchandra.dv at toradex.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _LPUART32_SERIAL_H
+#define _LPUART32_SERIAL_H
+
+struct lpuart_serial_platdata {
+ uint32_t base_addr;
+};
+
+#endif
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c
index 8eaff5f..6d3977f 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -5,10 +5,13 @@
*/
#include <common.h>
+#include <dm.h>
#include <i2c.h>
#include <asm/io.h>
#include <asm/arch/immap_ls102xa.h>
#include <asm/arch/clock.h>
+#include <asm/arch/config.h>
+#include <asm/arch/serial.h>
#include <asm/arch/fsl_serdes.h>
#include <asm/arch/ls102xa_stream_id.h>
#include <asm/arch/ls102xa_devdis.h>
@@ -31,7 +34,6 @@
#include "../../../drivers/qe/qe.h"
#endif
-
DECLARE_GLOBAL_DATA_PTR;
#define VERSION_MASK 0x00FF
@@ -793,3 +795,14 @@ U_BOOT_CMD(
"\nWARNING: If you aren't familiar with the setting of serdes, don't try to change anything!\n"
);
#endif
+
+#ifdef CONFIG_FSL_LPUART
+static struct lpuart_serial_platdata lpuart_serial_plat = {
+ .base_addr = LPUART_BASE,
+};
+
+U_BOOT_DEVICE(lpuart_serial) = {
+ .name = "serial_lpuart32",
+ .platdata = &lpuart_serial_plat,
+};
+#endif
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index c12ba3a..896c419 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -266,6 +266,7 @@
* Serial Port
*/
#ifdef CONFIG_LPUART
+#define CONFIG_DM_SERIAL
#define CONFIG_FSL_LPUART
#define CONFIG_LPUART_32B_REG
#else
--
2.7.0
More information about the U-Boot
mailing list