
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.
The device tree includes the other 2 UARTs found on a Malta system too, in order that they can be used easily by tweaking the chosen node.
Signed-off-by: Paul Burton paul.burton@imgtec.com ---
arch/mips/Kconfig | 5 +++++ arch/mips/dts/Makefile | 2 +- arch/mips/dts/mti,malta.dts | 50 +++++++++++++++++++++++++++++++++++++++++++++ board/imgtec/malta/malta.c | 13 ------------ configs/malta_defconfig | 1 + configs/maltael_defconfig | 1 + include/configs/malta.h | 8 +------- 7 files changed, 59 insertions(+), 21 deletions(-) create mode 100644 arch/mips/dts/mti,malta.dts
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 585887c..aaaf3c0 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -23,7 +23,12 @@ 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_EMBED + select OF_ISA_BUS select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN select SUPPORTS_CPU_MIPS32_R1 diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index 47b6eb5..24b5e5a 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0+ #
-dtb-y += +dtb-$(CONFIG_TARGET_MALTA) += mti,malta.dtb
targets += $(dtb-y)
diff --git a/arch/mips/dts/mti,malta.dts b/arch/mips/dts/mti,malta.dts new file mode 100644 index 0000000..30a8b50 --- /dev/null +++ b/arch/mips/dts/mti,malta.dts @@ -0,0 +1,50 @@ +/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 { + compatible = "isa"; + #address-cells = <2>; + #size-cells = <1>; + ranges = <1 0 0 0x1000>; + + uart1: serial@2f8 { + compatible = "ns16550a"; + + reg = <1 0x2f8 0x40>; + reg-shift = <0>; + + clock-frequency = <1843200>; + }; + + uart0: serial@3f8 { + compatible = "ns16550a"; + + reg = <1 0x3f8 0x40>; + reg-shift = <0>; + + clock-frequency = <1843200>; + + u-boot,dm-pre-reloc; + }; + }; + + uart2: serial@1f000900 { + compatible = "ns16550a"; + + reg = <0x1f000900 0x40>; + reg-shift = <3>; + + clock-frequency = <3686400>; + }; +}; diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index e31331a..dc6a510 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -12,7 +12,6 @@ #include <pci_gt64120.h> #include <pci_msc01.h> #include <rtc.h> -#include <serial.h>
#include <asm/addrspace.h> #include <asm/io.h> @@ -161,18 +160,6 @@ int misc_init_r(void) return 0; }
-struct serial_device *default_serial_console(void) -{ - switch (malta_sys_con()) { - case SYSCON_GT64120: - return &eserial1_device; - - default: - case SYSCON_MSC01: - return &eserial2_device; - } -} - void pci_init_board(void) { pci_dev_t bdf; diff --git a/configs/malta_defconfig b/configs/malta_defconfig index 2ebd58b..16839e1 100644 --- a/configs/malta_defconfig +++ b/configs/malta_defconfig @@ -7,3 +7,4 @@ CONFIG_TARGET_MALTA=y # CONFIG_CMD_NFS is not set CONFIG_SYS_NS16550=y CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_DEFAULT_DEVICE_TREE="mti,malta" diff --git a/configs/maltael_defconfig b/configs/maltael_defconfig index d24d217..f42af8e 100644 --- a/configs/maltael_defconfig +++ b/configs/maltael_defconfig @@ -8,3 +8,4 @@ CONFIG_SYS_LITTLE_ENDIAN=y # CONFIG_CMD_NFS is not set CONFIG_SYS_NS16550=y CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_DEFAULT_DEVICE_TREE="mti,malta" diff --git a/include/configs/malta.h b/include/configs/malta.h index aecc8ce..5311d24 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -13,6 +13,7 @@ #define CONFIG_MALTA #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_OF_LIBFDT
#define CONFIG_MEMSIZE_IN_BYTES
@@ -77,13 +78,6 @@ */ #define CONFIG_BAUDRATE 115200
-#define CONFIG_SYS_NS16550_SERIAL -#define CONFIG_SYS_NS16550_REG_SIZE 1 -#define CONFIG_SYS_NS16550_CLK (115200 * 16) -#define CONFIG_SYS_NS16550_COM1 0xb80003f8 -#define CONFIG_SYS_NS16550_COM2 0xbb0003f8 -#define CONFIG_CONS_INDEX 1 - /* * Flash configuration */