diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c index f77fcad..7700eb3 100644 --- a/arch/mips/boards/qemu-malta/init.c +++ b/arch/mips/boards/qemu-malta/init.c @@ -17,36 +17,11 @@ */ #include -#include -#include #include -#include -#include -#include #include -static int malta_devices_init(void) +static int malta_core_init(void) { - add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0); - - devfs_add_partition("nor0", 0x0, SZ_512K, DEVFS_PARTITION_FIXED, "self"); - devfs_add_partition("nor0", SZ_512K, SZ_64K, DEVFS_PARTITION_FIXED, "env0"); - return 0; } -device_initcall(malta_devices_init); - -static struct NS16550_plat serial_plat = { - .clock = 1843200, /* no matter for emulated port */ - .shift = 0, -}; - -static int malta_console_init(void) -{ - /* Register the serial port */ - add_ns16550_device(DEVICE_ID_DYNAMIC, MALTA_PIIX4_UART0, 8, - IORESOURCE_MEM_8BIT, &serial_plat); - - return 0; -} -console_initcall(malta_console_init); +core_initcall(malta_core_init); diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig index 18c840d..1b9ee9a 100644 --- a/arch/mips/configs/qemu-malta_defconfig +++ b/arch/mips/configs/qemu-malta_defconfig @@ -54,6 +54,7 @@ CONFIG_NET_NETCONSOLE=y CONFIG_NET_RESOLV=y CONFIG_OFDEVICE=y +CONFIG_OF_BAREBOX_DRIVERS=y # CONFIG_SPI is not set CONFIG_MTD=y CONFIG_DRIVER_CFI=y diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts index c4dcf05..4057729 100644 --- a/arch/mips/dts/qemu-malta.dts +++ b/arch/mips/dts/qemu-malta.dts @@ -6,7 +6,40 @@ model = "qemu malta"; compatible = "qemu,malta"; + chosen { + environment@0 { + compatible = "barebox,environment"; + device-path = &nor0, "partname:barebox-environment"; + }; + }; + memory { reg = <0x00000000 0x10000000>; }; + + uart0: serial@b00003f8 { + compatible = "ns16550a"; + reg = <0xb00003f8 0x08>; + reg-shift = <0>; + /* no matter for emulated port */ + clock-frequency = <1843200>; + }; + + nor0: flash@be000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0xbe000000 0x00400000>; + + partition@0 { + label = "barebox"; + reg = <0 0x80000>; + read-only; + }; + + partition@80000 { + label = "barebox-environment"; + reg = <0x80000 0x10000>; + }; + }; };