Skip to contentSkip to conversation

integrator: switch to DM serial port

PATCH New Linus Walleij 2 participants 2 messages Jul 27, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 integrator: switch to DM serial port

This switches the Integrator boards over to using the device model for its serial ports.

Cc Masahiro Yamada <[email protected]>

---
ChangeLog v1->v2:
- Moved CONFIG_DM and CONFIG_DM_SERIAL to Kconfig selects
- Moved CONFIG_SYS_MALLOC_F_LEN to Kconfig option

---
 arch/arm/Kconfig                     |  2 ++
 arch/arm/mach-integrator/Kconfig     |  3 +++
 board/armltd/integrator/integrator.c | 18 ++++++++++++++++++
 include/configs/integrator-common.h  |  5 +++++
 include/configs/integratorap.h       | 11 -----------
 include/configs/integratorcp.h       |  9 ---------
 6 files changed, 28 insertions(+), 20 deletions(-)
arch/arm/Kconfig +2 -0
index 3355b3bcaa58..04006176553c 100644
@@ -457,6 +457,8 @@ config ARCH_HIGHBANK
 
 config ARCH_INTEGRATOR
 	bool "ARM Ltd. Integrator family"
+	select DM
+	select DM_SERIAL
 
 config ARCH_KEYSTONE
 	bool "TI Keystone"
arch/arm/mach-integrator/Kconfig +3 -0
index c54d69db0e42..d506ee5b39cd 100644
@@ -53,4 +53,7 @@ config SYS_CONFIG_NAME
 	default "integratorap" if ARCH_INTEGRATOR_AP
 	default "integratorcp" if ARCH_INTEGRATOR_CP
 
+config SYS_MALLOC_F_LEN
+	default 0x2000
+
 endmenu
board/armltd/integrator/integrator.c +18 -0
index e94ac850c751..cbe706170d0f 100644
@@ -20,11 +20,29 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/io.h>
+#include <dm/platdata.h>
+#include <dm/platform_data/serial_pl01x.h>
 #include "arm-ebi.h"
 #include "integrator-sc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static const struct pl01x_serial_platdata serial_platdata = {
+	.base = 0x16000000,
+#ifdef CONFIG_ARCH_CINTEGRATOR
+	.type = TYPE_PL011,
+	.clock = 14745600,
+#else
+	.type = TYPE_PL010,
+	.clock = 0, /* Not used for PL010 */
+#endif
+};
+
+U_BOOT_DEVICE(integrator_serials) = {
+	.name = "serial_pl01x",
+	.platdata = &serial_platdata,
+};
+
 void peripheral_power_enable (void);
 
 #if defined(CONFIG_SHOW_BOOT_PROGRESS)
include/configs/integrator-common.h +5 -0
index 1d307ca1e6a8..a22efd699c17 100644
@@ -20,6 +20,11 @@
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size*/
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 128*1024) /* Size of malloc() pool */
 
+/* Serial port PL010/PL011 through the device model */
+#define CONFIG_PL01X_SERIAL
+#define CONFIG_BAUDRATE			38400
+#define CONFIG_CONS_INDEX		0
+
 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs  */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_OF_LIBFDT		/* enable passing a Device Tree */
include/configs/integratorap.h +0 -11
index c76ebcbb60a9..26aa8cadc01d 100644
@@ -21,17 +21,6 @@
 #define CONFIG_SYS_HZ_CLOCK		24000000	/* Timer 1 is clocked at 24Mhz */
 
 /*
- * PL010 Configuration
- */
-#define CONFIG_PL010_SERIAL
-#define CONFIG_CONS_INDEX	0
-#define CONFIG_BAUDRATE		38400
-#define CONFIG_PL01x_PORTS	{ (void *) (CONFIG_SYS_SERIAL0), (void *) (CONFIG_SYS_SERIAL1) }
-#define CONFIG_SYS_SERIAL0		0x16000000
-#define CONFIG_SYS_SERIAL1		0x17000000
-
-
-/*
  * BOOTP options
  */
 #define CONFIG_BOOTP_BOOTFILESIZE
include/configs/integratorcp.h +0 -9
index d6f260287534..4d04f544c815 100644
@@ -28,15 +28,6 @@
 #define CONFIG_SMC91111_BASE    0xC8000000
 #undef CONFIG_SMC91111_EXT_PHY
 
-/* PL011 configuration */
-#define CONFIG_PL011_SERIAL
-#define CONFIG_PL011_CLOCK	14745600
-#define CONFIG_PL01x_PORTS	{ (void *)CONFIG_SYS_SERIAL0, (void *)CONFIG_SYS_SERIAL1 }
-#define CONFIG_CONS_INDEX	0
-#define CONFIG_BAUDRATE		38400
-#define CONFIG_SYS_SERIAL0		0x16000000
-#define CONFIG_SYS_SERIAL1		0x17000000
-
 /*
  * Command line configuration.
  */
Signature · 1 line
2.4.3
#1 lore raw

PATCH v2 1/1 integrator: switch to DM serial port

Quoted 5 lines · Linus Walleij

This switches the Integrator boards over to using the device model for its serial ports.

Cc Masahiro Yamada <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/d99cb6be/attachment-0001.sig>