From: Linus Walleij Date: Mon, 27 Jul 2015 09:22:48 +0000 (+0200) Subject: integrator: switch to DM serial port X-Git-Tag: KARO-TX6-2015-09-18~445 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=43b0fb080685c6ddef5aef21a78139ee960542aa;p=karo-tx-uboot.git integrator: switch to DM serial port This switches the Integrator boards over to using the device model for its serial ports. Cc: Masahiro Yamada Signed-off-by: Linus Walleij --- diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1fa661603a..70c707067e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -541,6 +541,8 @@ config ARCH_HIGHBANK config ARCH_INTEGRATOR bool "ARM Ltd. Integrator family" + select DM + select DM_SERIAL config ARCH_KEYSTONE bool "TI Keystone" diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index c54d69db0e..d506ee5b39 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig @@ -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 diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index e94ac850c7..cbe706170d 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -20,11 +20,29 @@ #include #include #include +#include +#include #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) diff --git a/include/configs/integrator-common.h b/include/configs/integrator-common.h index 1d307ca1e6..a22efd699c 100644 --- a/include/configs/integrator-common.h +++ b/include/configs/integrator-common.h @@ -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 */ diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h index c76ebcbb60..26aa8cadc0 100644 --- a/include/configs/integratorap.h +++ b/include/configs/integratorap.h @@ -20,17 +20,6 @@ /* Integrator/AP-specific configuration */ #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 */ diff --git a/include/configs/integratorcp.h b/include/configs/integratorcp.h index d6f2602875..4d04f544c8 100644 --- a/include/configs/integratorcp.h +++ b/include/configs/integratorcp.h @@ -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. */