integrator: switch to DM serial port
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 27 Jul 2015 09:22:48 +0000 (11:22 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 13 Aug 2015 00:47:49 +0000 (20:47 -0400)
This switches the Integrator boards over to using the device model
for its serial ports.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/Kconfig
arch/arm/mach-integrator/Kconfig
board/armltd/integrator/integrator.c
include/configs/integrator-common.h
include/configs/integratorap.h
include/configs/integratorcp.h

index f2eb09f921923f23a7f6788ab7125b0e6d6a5820..a436e8123bf7dd81a865d1b9fb8882273954b795 100644 (file)
@@ -458,6 +458,8 @@ config ARCH_HIGHBANK
 
 config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
+       select DM
+       select DM_SERIAL
 
 config ARCH_KEYSTONE
        bool "TI Keystone"
index c54d69db0e4276a3e4236f24668fa87da20fe153..d506ee5b39cda6eb051c396259b0800df6f986ac 100644 (file)
@@ -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
index e94ac850c7515b66948a1f428cdab79619b2322c..cbe706170d0fd5fe1a442e18c02421050ff5961d 100644 (file)
 #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)
index 1d307ca1e6a81040003492147e053b113303374d..a22efd699c17a496977acaa7952474b8fe6513b4 100644 (file)
 #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 */
index c76ebcbb60a99eaa7bc708669e287077bee89a61..26aa8cadc01ded0773817cbefeb1b949ba531fd7 100644 (file)
 /* 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
  */
index d6f260287534338532c50c0b8157b361ba76b91d..4d04f544c815ad872d26af512ab9f1bbd89f41f5 100644 (file)
 #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.
  */