]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
corvus DTS / DM support
authorHeiko Schocher <hs@denx.de>
Wed, 25 May 2016 05:23:45 +0000 (07:23 +0200)
committerAndreas Bießmann <andreas@biessmann.org>
Sun, 26 Jun 2016 18:17:22 +0000 (20:17 +0200)
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
[rebase on current ToT, don't delete gurnard DTB creation]
Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
arch/arm/dts/Makefile
arch/arm/dts/at91sam9g45-corvus.dts [new file with mode: 0644]
arch/arm/mach-at91/Kconfig
board/siemens/corvus/board.c
configs/corvus_defconfig
include/configs/corvus.h

index de75e24d1bf7168fad6e0397ecdd9f503b9e9d12..5338a39bba9f631101d4e66f27e469f7f72343f0 100644 (file)
@@ -2,7 +2,9 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-dtb-$(CONFIG_AT91FAMILY) += at91sam9g45-gurnard.dtb
+dtb-$(CONFIG_AT91FAMILY) += at91sam9g45-corvus.dtb \
+       at91sam9g45-gurnard.dtb
+
 dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
 dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
diff --git a/arch/arm/dts/at91sam9g45-corvus.dts b/arch/arm/dts/at91sam9g45-corvus.dts
new file mode 100644 (file)
index 0000000..c207c02
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * at91sam9g45-corvus.dts Device Tree file fir Siemens corvus board
+ * (C) Copyright 2016 Heiko Schocher <hs@denx.de>
+ *
+ * based on:
+ * at91sam9m10g45ek.dts - Device Tree file for AT91SAM9M10G45-EK board
+ *
+ *  Copyright (C) 2011 Atmel,
+ *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+/dts-v1/;
+#include "at91sam9g45.dtsi"
+
+/ {
+       model = "Siemens corvus";
+       compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";
+
+       chosen {
+               stdout-path = &dbgu;
+       };
+
+       memory {
+               reg = <0x70000000 0x8000000>;
+       };
+
+       clocks {
+               slow_xtal {
+                     clock-frequency = <32768>;
+               };
+
+               main_xtal {
+                     clock-frequency = <12000000>;
+               };
+       };
+
+       ahb {
+               apb {
+                       dbgu: serial@ffffee00 {
+                               status = "okay";
+                       };
+
+                       usart1: serial@fff90000 {
+                               pinctrl-0 =
+                                       <&pinctrl_usart1
+                                        &pinctrl_usart1_rts
+                                        &pinctrl_usart1_cts>;
+                               status = "okay";
+                       };
+
+                       macb0: ethernet@fffbc000 {
+                               phy-mode = "rmii";
+                               status = "okay";
+                       };
+
+                       watchdog@fffffd40 {
+                               status = "okay";
+                       };
+
+                       spi0: spi@fffa4000{
+                               status = "okay";
+                               cs-gpios = <&pioB 3 0>, <0>, <0>, <0>;
+                               mtd_dataflash@0 {
+                                       compatible = "atmel,at45", "atmel,dataflash";
+                                       spi-max-frequency = <13000000>;
+                                       reg = <0>;
+                               };
+                       };
+
+                       usb2: gadget@fff78000 {
+                               atmel,vbus-gpio = <&pioB 19 GPIO_ACTIVE_HIGH>;
+                               status = "okay";
+                       };
+
+                       rtc@fffffd20 {
+                               atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
+                               status = "okay";
+                       };
+
+                       gpbr: syscon@fffffd60 {
+                               status = "okay";
+                       };
+
+                       rtc@fffffdb0 {
+                               status = "okay";
+                       };
+               };
+
+               nand0: nand@40000000 {
+                       nand-bus-width = <8>;
+                       nand-ecc-mode = "soft";
+                       nand-on-flash-bbt;
+                       status = "okay";
+               };
+
+               usb0: ohci@00700000 {
+                       status = "okay";
+                       num-ports = <2>;
+                       atmel,vbus-gpio = <&pioD 1 GPIO_ACTIVE_LOW
+                                          &pioD 3 GPIO_ACTIVE_LOW>;
+               };
+
+               usb1: ehci@00800000 {
+                       status = "okay";
+               };
+       };
+};
index 6180699fed9593e279ee03546c1d46cce26e86bd..0ff0d1d82d42685efc234f53c5cc294a5f434656 100644 (file)
@@ -122,6 +122,10 @@ config TARGET_CORVUS
        bool "Support corvus"
        select CPU_ARM926EJS
        select SUPPORT_SPL
+       select DM
+       select DM_SERIAL
+       select DM_GPIO
+       select DM_ETH
 
 config TARGET_TAURUS
        bool "Support taurus"
index 9d5266151b03f4ece34594f3c04376cb135df47b..d4416e64683c939dc1eebbd98c8a051eb1b5e208 100644 (file)
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9g45_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/atmel_serial.h>
 #include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/clk.h>
-#include <lcd.h>
-#include <atmel_lcdc.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
+#ifndef CONFIG_DM_ETH
 #include <netdev.h>
+#endif
 #include <spi.h>
 
 #ifdef CONFIG_USB_GADGET_ATMEL_USBA
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static void corvus_request_gpio(void)
+{
+       gpio_request(CONFIG_SYS_NAND_ENABLE_PIN, "nand ena");
+       gpio_request(CONFIG_SYS_NAND_READY_PIN, "nand rdy");
+       gpio_request(AT91_PIN_PD7, "d0");
+       gpio_request(AT91_PIN_PD8, "d1");
+       gpio_request(AT91_PIN_PA12, "d2");
+       gpio_request(AT91_PIN_PA13, "d3");
+       gpio_request(AT91_PIN_PA15, "d4");
+       gpio_request(AT91_PIN_PB7, "recovery button");
+       gpio_request(AT91_PIN_PD1, "USB0");
+       gpio_request(AT91_PIN_PD3, "USB1");
+       gpio_request(AT91_PIN_PB18, "SPICS1");
+       gpio_request(AT91_PIN_PB3, "SPICS0");
+       gpio_request(CONFIG_RED_LED, "red led");
+       gpio_request(CONFIG_GREEN_LED, "green led");
+}
+
 static void corvus_nand_hw_init(void)
 {
        struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
@@ -78,6 +98,7 @@ static void corvus_nand_hw_init(void)
 
 void spl_board_init(void)
 {
+       corvus_request_gpio();
        /*
         * For on the sam9m10g45ek board, the chip wm9711 stay in the test
         * mode, so it need do some action to exit mode.
@@ -200,6 +221,7 @@ static void corvus_macb_hw_init(void)
 int board_early_init_f(void)
 {
        at91_seriald_hw_init();
+       corvus_request_gpio();
        return 0;
 }
 
@@ -220,6 +242,8 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
+       /* we have to request the gpios again after relocation */
+       corvus_request_gpio();
 #ifdef CONFIG_CMD_NAND
        corvus_nand_hw_init();
 #endif
@@ -249,6 +273,7 @@ int dram_init(void)
        return 0;
 }
 
+#ifndef CONFIG_DM_ETH
 int board_eth_init(bd_t *bis)
 {
        int rc = 0;
@@ -257,6 +282,7 @@ int board_eth_init(bd_t *bis)
 #endif
        return rc;
 }
+#endif
 
 /* SPI chip select control */
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
@@ -289,3 +315,12 @@ void spi_cs_deactivate(struct spi_slave *slave)
                        break;
        }
 }
+
+static struct atmel_serial_platdata at91sam9260_serial_plat = {
+       .base_addr = ATMEL_BASE_DBGU,
+};
+
+U_BOOT_DEVICE(at91sam9260_serial) = {
+       .name   = "serial_atmel",
+       .platdata = &at91sam9260_serial_plat,
+};
index 2efffb59851056fe57ac00d3b57e9c31ee3836f8..51d1516457e0f7ce07709fbe4b0fc7190fc2fe34 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_TARGET_CORVUS=y
+CONFIG_DEFAULT_DEVICE_TREE="at91sam9g45-corvus"
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
@@ -14,6 +15,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -25,3 +28,8 @@ CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 CONFIG_OF_LIBFDT=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
+CONFIG_USB=y
+CONFIG_USB_GADGET=y
+# CONFIG_EFI_LOADER is not set
index 686760d0a532d7af3db8c2da2d9624c64bd29561..e6a811af03f835641039e4763d365f4f0081113c 100644 (file)
@@ -35,7 +35,7 @@
 #define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs      */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
-#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DISPLAY_CPUINFO