From 5c3f5edbe0a1dff3f0b74f586f18f11e5c310f3c Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 14 Oct 2014 15:05:57 +0200 Subject: [PATCH 1/8] ARM: realview: add flash devices to the PB1176 DTS This adds the flash memories and ROM to the PB1175 DTS file. The secure flash is marked as "disabled" by default so as to protect the user from overwriting the boot monitor. Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index 1bc64cda819e..b7d727ef1868 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -106,6 +106,31 @@ clock-frequency = <0>; }; + flash@30000000 { + compatible = "arm,versatile-flash", "cfi-flash"; + reg = <0x30000000 0x4000000>; + bank-width = <4>; + }; + + fpga_flash@38000000 { + compatible = "arm,versatile-flash", "cfi-flash"; + reg = <0x38000000 0x800000>; + bank-width = <4>; + }; + + /* + * The "secure flash" contains things like the boot + * monitor so we don't want people to accidentally + * screw this up. Mark the device tree node disabled + * by default. + */ + secflash@3c000000 { + compatible = "arm,versatile-flash", "cfi-flash"; + reg = <0x3c000000 0x4000000>; + bank-width = <4>; + status = "disabled"; + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -297,6 +322,13 @@ clocks = <&uartclk>, <&pclk>; clock-names = "uartclk", "apb_pclk"; }; + + /* Direct-mapped development chip ROM */ + pb1176_rom@10200000 { + compatible = "direct-mapped"; + reg = <0x10200000 0x4000>; + bank-width = <1>; + }; }; /* These peripherals are inside the FPGA rather than the DevChip */ From 1f138b18936d406361591a77903386c6d940a91a Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 26 Jan 2016 11:42:25 +0100 Subject: [PATCH 2/8] ARM: realview: fix up PB11MP flash compat strings The two flash memories in the PB11MPCore have their VPP/WP lines controlled from the system controller add-on in the MTD subsystem. "arm,versatile-flash" is the first compatible string to use to get the right support. Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb11mp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/arm-realview-pb11mp.dts b/arch/arm/boot/dts/arm-realview-pb11mp.dts index da755c9851a7..63d6a051839f 100644 --- a/arch/arm/boot/dts/arm-realview-pb11mp.dts +++ b/arch/arm/boot/dts/arm-realview-pb11mp.dts @@ -230,14 +230,14 @@ flash0@40000000 { /* 2 * 32MiB NOR Flash memory */ - compatible = "arm,vexpress-flash", "cfi-flash"; + compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x40000000 0x04000000>; bank-width = <4>; }; flash1@44000000 { // 2 * 32MiB NOR Flash memory - compatible = "arm,vexpress-flash", "cfi-flash"; + compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x44000000 0x04000000>; bank-width = <4>; }; From 2d76ab2b61e06c9fde0a69e9df0f5f4f69c251fa Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 12 Jan 2016 14:50:47 +0100 Subject: [PATCH 3/8] ARM: pb1176: add ICST307 clocks to the device tree This adds the five ICST307 clocks to the device tree, so we can use these with e.g. CLCD. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index b7d727ef1868..d0855bf73611 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -201,6 +201,41 @@ label = "versatile:7"; default-state = "off"; }; + oscclk0: osc0@0c { + compatible = "arm,syscon-icst307"; + #clock-cells = <0>; + lock-offset = <0x20>; + vco-offset = <0x0C>; + clocks = <&xtal24mhz>; + }; + oscclk1: osc1@10 { + compatible = "arm,syscon-icst307"; + #clock-cells = <0>; + lock-offset = <0x20>; + vco-offset = <0x10>; + clocks = <&xtal24mhz>; + }; + oscclk2: osc2@14 { + compatible = "arm,syscon-icst307"; + #clock-cells = <0>; + lock-offset = <0x20>; + vco-offset = <0x14>; + clocks = <&xtal24mhz>; + }; + oscclk3: osc3@18 { + compatible = "arm,syscon-icst307"; + #clock-cells = <0>; + lock-offset = <0x20>; + vco-offset = <0x18>; + clocks = <&xtal24mhz>; + }; + oscclk4: osc4@1c { + compatible = "arm,syscon-icst307"; + #clock-cells = <0>; + lock-offset = <0x20>; + vco-offset = <0x1c>; + clocks = <&xtal24mhz>; + }; }; /* Primary DevChip GIC synthesized with the CPU */ From efcf8963c659f41d44550ccd17e5ed24a97a3e23 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 14 Jan 2016 13:23:48 +0100 Subject: [PATCH 4/8] ARM: pb1176: add AACI to the device tree The device tree was missing the definition of the AACI Advanced Audio Codec Interface, so add it. Tested on the hardware and it works. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index d0855bf73611..f02d1f14619a 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -373,6 +373,15 @@ compatible = "simple-bus"; ranges; + fpga_aaci: aaci@10004000 { + compatible = "arm,pl041", "arm,primecell"; + reg = <0x10004000 0x1000>; + interrupt-parent = <&intc_fpga1176>; + interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pclk>; + clock-names = "apb_pclk"; + }; + fpga_mci: mmcsd@10005000 { compatible = "arm,pl18x", "arm,primecell"; reg = <0x10005000 0x1000>; From cc9ab84cd942dfc5154177cedd365bce6406d263 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 14 Jan 2016 13:36:48 +0100 Subject: [PATCH 5/8] ARM: pb1176: add ISP1761 USB OTG host controller The USB host controller was missing from the device tree so add it. This device is not inside either the development chip or the FPGA but mounted on the board, so it ends up in the root node of the device tree. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index f02d1f14619a..8a0bc4222cfc 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -131,6 +131,14 @@ status = "disabled"; }; + usb@3b000000 { + compatible = "nxp,usb-isp1761"; + reg = <0x3b000000 0x20000>; + interrupt-parent = <&intc_fpga1176>; + interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>; + port1-otg; + }; + soc { #address-cells = <1>; #size-cells = <1>; From 3bf0a4194f1a149c17373d83a9fde94d84b4098a Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 14 Jan 2016 13:52:40 +0100 Subject: [PATCH 6/8] ARM: pb1176: add ethernet to devicetree The PB1176 device tree was missing the SMSC9118 ethernet adapter, so add it. Since this peripheral is not in either development chip but on the board itself, it gets defined in the root node of the device tree. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index 8a0bc4222cfc..76ecce24fb70 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -53,6 +53,14 @@ regulator-boot-on; }; + veth: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "veth"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + xtal24mhz: xtal24mhz@24M { #clock-cells = <0>; compatible = "fixed-clock"; @@ -131,6 +139,20 @@ status = "disabled"; }; + /* SMSC 9118 ethernet with PHY and EEPROM */ + ethernet@3a000000 { + compatible = "smsc,lan9118", "smsc,lan9115"; + reg = <0x3a000000 0x10000>; + interrupt-parent = <&intc_fpga1176>; + interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>; + phy-mode = "mii"; + reg-io-width = <4>; + smsc,irq-active-high; + smsc,irq-push-pull; + vdd33a-supply = <&veth>; + vddvario-supply = <&veth>; + }; + usb@3b000000 { compatible = "nxp,usb-isp1761"; reg = <0x3b000000 0x20000>; From 820617c25127d8c1074762c62b69ef2f6f6f9bb9 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 18 Jan 2016 11:02:03 +0100 Subject: [PATCH 7/8] ARM: realview: add the DS1338 RTC to PB1176 DT This adds the Versatile I2C adapter and the Dallas DS1338 RTC on it to the PB1176 device tree. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/arm-realview-pb1176.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index 76ecce24fb70..652d85b28aaa 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -403,6 +403,18 @@ compatible = "simple-bus"; ranges; + i2c0: i2c@10002000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "arm,versatile-i2c"; + reg = <0x10002000 0x1000>; + + rtc@68 { + compatible = "dallas,ds1338"; + reg = <0x68>; + }; + }; + fpga_aaci: aaci@10004000 { compatible = "arm,pl041", "arm,primecell"; reg = <0x10004000 0x1000>; From 1c6e288da6cc3c72579ff0062b5a5684fb9ef90e Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 25 Jan 2016 09:23:02 +0100 Subject: [PATCH 8/8] ARM: versatile: move restart to the device tree We have a power/reset driver for the Versatile family in drivers/power/reset so let's just activate that driver and use it and get rid of some non-DT remnants. Cc: Rob Herring Signed-off-by: Linus Walleij --- arch/arm/mach-versatile/Kconfig | 3 +++ arch/arm/mach-versatile/versatile_dt.c | 15 --------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig index e40f777ccf7d..b0cc26284fc9 100644 --- a/arch/arm/mach-versatile/Kconfig +++ b/arch/arm/mach-versatile/Kconfig @@ -8,8 +8,11 @@ config ARCH_VERSATILE select COMMON_CLK_VERSATILE select CPU_ARM926T select ICST + select MFD_SYSCON select MIGHT_HAVE_PCI select PLAT_VERSATILE + select POWER_RESET + select POWER_RESET_VERSATILE select VERSATILE_FPGA_IRQ help This enables support for ARM Ltd Versatile board. diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index c44871851255..dff1c0595b67 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -52,8 +52,6 @@ * Versatile Registers * ------------------------------------------------------------------------ */ -#define VERSATILE_SYS_LOCK_OFFSET 0x20 -#define VERSATILE_SYS_RESETCTL_OFFSET 0x40 #define VERSATILE_SYS_PCICTL_OFFSET 0x44 #define VERSATILE_SYS_MCI_OFFSET 0x48 #define VERSATILE_SYS_FLASH_OFFSET 0x4C @@ -345,18 +343,6 @@ static void __init versatile_init_early(void) __io_address(VERSATILE_SCTL_BASE)); } -static void versatile_restart(enum reboot_mode mode, const char *cmd) -{ - u32 val; - - val = readl(versatile_sys_base + VERSATILE_SYS_RESETCTL_OFFSET); - val |= 0x105; - - writel(0xa05f, versatile_sys_base + VERSATILE_SYS_LOCK_OFFSET); - writel(val, versatile_sys_base + VERSATILE_SYS_RESETCTL_OFFSET); - writel(0, versatile_sys_base + VERSATILE_SYS_LOCK_OFFSET); -} - static void __init versatile_dt_pci_init(void) { u32 val; @@ -420,5 +406,4 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)") .init_early = versatile_init_early, .init_machine = versatile_dt_init, .dt_compat = versatile_dt_match, - .restart = versatile_restart, MACHINE_END