]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
malta: Use device model & tree for UART
authorPaul Burton <paul.burton@imgtec.com>
Tue, 17 May 2016 06:43:28 +0000 (07:43 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 25 May 2016 23:34:13 +0000 (01:34 +0200)
Make use of device model & device tree to probe the UART driver. This is
the initial step in bringing Malta up to date with driver model, and
allows for cleaner handling of the different I/O addresses for different
system controllers by specifying the ISA bus address instead of a
translated memory address.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
arch/mips/Kconfig
arch/mips/dts/Makefile
arch/mips/dts/mti,malta.dts [new file with mode: 0644]
configs/malta_defconfig
configs/maltael_defconfig
include/configs/malta.h

index dc34c18258cbf9aad441fd1b8145ecfd88f13a76..53363e38fe4309fa751716ce1d25a12d6d0e3d58 100644 (file)
@@ -23,7 +23,11 @@ config TARGET_QEMU_MIPS
 
 config TARGET_MALTA
        bool "Support malta"
+       select DM
+       select DM_SERIAL
        select DYNAMIC_IO_PORT_BASE
+       select OF_CONTROL
+       select OF_ISA_BUS
        select SUPPORTS_BIG_ENDIAN
        select SUPPORTS_LITTLE_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
index a94b74555073d5c0c59bfdaae1f07e1a0e13f542..2f04d73b83ffc824cdadb4c903085bf6997698c3 100644 (file)
@@ -4,6 +4,7 @@
 
 dtb-$(CONFIG_TARGET_AP121) += ap121.dtb
 dtb-$(CONFIG_TARGET_AP143) += ap143.dtb
+dtb-$(CONFIG_TARGET_MALTA) += mti,malta.dtb
 dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb
 dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb
 
diff --git a/arch/mips/dts/mti,malta.dts b/arch/mips/dts/mti,malta.dts
new file mode 100644 (file)
index 0000000..d339229
--- /dev/null
@@ -0,0 +1,32 @@
+/dts-v1/;
+
+/memreserve/ 0x00000000 0x00001000;    /* Exception vectors */
+/memreserve/ 0x000f0000 0x00010000;    /* PIIX4 ISA memory */
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       compatible = "mti,malta";
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       isa@0 {
+               compatible = "isa";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               ranges = <1 0 0 0x1000>;
+
+               uart0: serial@3f8 {
+                       compatible = "ns16550a";
+
+                       reg = <1 0x3f8 0x40>;
+                       reg-shift = <0>;
+
+                       clock-frequency = <1843200>;
+
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
index a16f10be6a0f4f5895aab6492857ab03648a5b7c..3c3bb1652249128fea98533102f46da8252cd17b 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_MIPS=y
 CONFIG_TARGET_MALTA=y
+CONFIG_DEFAULT_DEVICE_TREE="mti,malta"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="malta # "
 # CONFIG_CMD_LOADB is not set
@@ -9,5 +10,6 @@ CONFIG_SYS_PROMPT="malta # "
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
+CONFIG_OF_EMBED=y
 CONFIG_SYS_NS16550=y
 CONFIG_USE_PRIVATE_LIBGCC=y
index 528979774879a2ce9a83ccd07fd3d02bfc305acb..b245d915ef77bfeb0fe0f1b454ead733d3747609 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_MIPS=y
 CONFIG_TARGET_MALTA=y
 CONFIG_SYS_LITTLE_ENDIAN=y
+CONFIG_DEFAULT_DEVICE_TREE="mti,malta"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="maltael # "
 # CONFIG_CMD_LOADB is not set
@@ -10,5 +11,6 @@ CONFIG_SYS_PROMPT="maltael # "
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
+CONFIG_OF_EMBED=y
 CONFIG_SYS_NS16550=y
 CONFIG_USE_PRIVATE_LIBGCC=y
index 1c3c83c25eb32c83b4cbfc19821c8a85cf0210e4..e03935b573282ad2edbc9dd2e6741e5490ce04aa 100644 (file)
  * Serial driver
  */
 #define CONFIG_BAUDRATE                        115200
-
-#define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_PORT_MAPPED
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         (115200 * 16)
-#define CONFIG_SYS_NS16550_COM1                0x3f8
-#define CONFIG_CONS_INDEX              1
 
 /*
  * Flash configuration