Commit 289f979cc9585b68ff74971d90512847f9b3c868

Authored by Heiko Schocher
Committed by Andreas Bießmann
1 parent ce9844ce17

corvus DTS / DM support

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>

Showing 6 changed files with 162 additions and 5 deletions Side-by-side Diff

arch/arm/dts/Makefile
... ... @@ -2,7 +2,9 @@
2 2 # SPDX-License-Identifier: GPL-2.0+
3 3 #
4 4  
5   -dtb-$(CONFIG_AT91FAMILY) += at91sam9g45-gurnard.dtb
  5 +dtb-$(CONFIG_AT91FAMILY) += at91sam9g45-corvus.dtb \
  6 + at91sam9g45-gurnard.dtb
  7 +
6 8 dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
7 9 dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
8 10 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
arch/arm/dts/at91sam9g45-corvus.dts
  1 +/*
  2 + * at91sam9g45-corvus.dts Device Tree file fir Siemens corvus board
  3 + * (C) Copyright 2016 Heiko Schocher <hs@denx.de>
  4 + *
  5 + * based on:
  6 + * at91sam9m10g45ek.dts - Device Tree file for AT91SAM9M10G45-EK board
  7 + *
  8 + * Copyright (C) 2011 Atmel,
  9 + * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
  10 + *
  11 + * SPDX-License-Identifier: GPL-2.0+
  12 + */
  13 +/dts-v1/;
  14 +#include "at91sam9g45.dtsi"
  15 +
  16 +/ {
  17 + model = "Siemens corvus";
  18 + compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";
  19 +
  20 + chosen {
  21 + stdout-path = &dbgu;
  22 + };
  23 +
  24 + memory {
  25 + reg = <0x70000000 0x8000000>;
  26 + };
  27 +
  28 + clocks {
  29 + slow_xtal {
  30 + clock-frequency = <32768>;
  31 + };
  32 +
  33 + main_xtal {
  34 + clock-frequency = <12000000>;
  35 + };
  36 + };
  37 +
  38 + ahb {
  39 + apb {
  40 + dbgu: serial@ffffee00 {
  41 + status = "okay";
  42 + };
  43 +
  44 + usart1: serial@fff90000 {
  45 + pinctrl-0 =
  46 + <&pinctrl_usart1
  47 + &pinctrl_usart1_rts
  48 + &pinctrl_usart1_cts>;
  49 + status = "okay";
  50 + };
  51 +
  52 + macb0: ethernet@fffbc000 {
  53 + phy-mode = "rmii";
  54 + status = "okay";
  55 + };
  56 +
  57 + watchdog@fffffd40 {
  58 + status = "okay";
  59 + };
  60 +
  61 + spi0: spi@fffa4000{
  62 + status = "okay";
  63 + cs-gpios = <&pioB 3 0>, <0>, <0>, <0>;
  64 + mtd_dataflash@0 {
  65 + compatible = "atmel,at45", "atmel,dataflash";
  66 + spi-max-frequency = <13000000>;
  67 + reg = <0>;
  68 + };
  69 + };
  70 +
  71 + usb2: gadget@fff78000 {
  72 + atmel,vbus-gpio = <&pioB 19 GPIO_ACTIVE_HIGH>;
  73 + status = "okay";
  74 + };
  75 +
  76 + rtc@fffffd20 {
  77 + atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
  78 + status = "okay";
  79 + };
  80 +
  81 + gpbr: syscon@fffffd60 {
  82 + status = "okay";
  83 + };
  84 +
  85 + rtc@fffffdb0 {
  86 + status = "okay";
  87 + };
  88 + };
  89 +
  90 + nand0: nand@40000000 {
  91 + nand-bus-width = <8>;
  92 + nand-ecc-mode = "soft";
  93 + nand-on-flash-bbt;
  94 + status = "okay";
  95 + };
  96 +
  97 + usb0: ohci@00700000 {
  98 + status = "okay";
  99 + num-ports = <2>;
  100 + atmel,vbus-gpio = <&pioD 1 GPIO_ACTIVE_LOW
  101 + &pioD 3 GPIO_ACTIVE_LOW>;
  102 + };
  103 +
  104 + usb1: ehci@00800000 {
  105 + status = "okay";
  106 + };
  107 + };
  108 +};
arch/arm/mach-at91/Kconfig
... ... @@ -122,6 +122,10 @@
122 122 bool "Support corvus"
123 123 select CPU_ARM926EJS
124 124 select SUPPORT_SPL
  125 + select DM
  126 + select DM_SERIAL
  127 + select DM_GPIO
  128 + select DM_ETH
125 129  
126 130 config TARGET_TAURUS
127 131 bool "Support taurus"
board/siemens/corvus/board.c
... ... @@ -11,21 +11,23 @@
11 11 * SPDX-License-Identifier: GPL-2.0+
12 12 */
13 13  
14   -
15 14 #include <common.h>
  15 +#include <dm.h>
16 16 #include <asm/io.h>
17 17 #include <asm/arch/at91sam9g45_matrix.h>
18 18 #include <asm/arch/at91sam9_smc.h>
19 19 #include <asm/arch/at91_common.h>
20 20 #include <asm/arch/at91_rstc.h>
  21 +#include <asm/arch/atmel_serial.h>
21 22 #include <asm/arch/gpio.h>
  23 +#include <asm/gpio.h>
22 24 #include <asm/arch/clk.h>
23   -#include <lcd.h>
24   -#include <atmel_lcdc.h>
25 25 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
26 26 #include <net.h>
27 27 #endif
  28 +#ifndef CONFIG_DM_ETH
28 29 #include <netdev.h>
  30 +#endif
29 31 #include <spi.h>
30 32  
31 33 #ifdef CONFIG_USB_GADGET_ATMEL_USBA
... ... @@ -34,6 +36,24 @@
34 36  
35 37 DECLARE_GLOBAL_DATA_PTR;
36 38  
  39 +static void corvus_request_gpio(void)
  40 +{
  41 + gpio_request(CONFIG_SYS_NAND_ENABLE_PIN, "nand ena");
  42 + gpio_request(CONFIG_SYS_NAND_READY_PIN, "nand rdy");
  43 + gpio_request(AT91_PIN_PD7, "d0");
  44 + gpio_request(AT91_PIN_PD8, "d1");
  45 + gpio_request(AT91_PIN_PA12, "d2");
  46 + gpio_request(AT91_PIN_PA13, "d3");
  47 + gpio_request(AT91_PIN_PA15, "d4");
  48 + gpio_request(AT91_PIN_PB7, "recovery button");
  49 + gpio_request(AT91_PIN_PD1, "USB0");
  50 + gpio_request(AT91_PIN_PD3, "USB1");
  51 + gpio_request(AT91_PIN_PB18, "SPICS1");
  52 + gpio_request(AT91_PIN_PB3, "SPICS0");
  53 + gpio_request(CONFIG_RED_LED, "red led");
  54 + gpio_request(CONFIG_GREEN_LED, "green led");
  55 +}
  56 +
37 57 static void corvus_nand_hw_init(void)
38 58 {
39 59 struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
... ... @@ -78,6 +98,7 @@
78 98  
79 99 void spl_board_init(void)
80 100 {
  101 + corvus_request_gpio();
81 102 /*
82 103 * For on the sam9m10g45ek board, the chip wm9711 stay in the test
83 104 * mode, so it need do some action to exit mode.
... ... @@ -200,6 +221,7 @@
200 221 int board_early_init_f(void)
201 222 {
202 223 at91_seriald_hw_init();
  224 + corvus_request_gpio();
203 225 return 0;
204 226 }
205 227  
... ... @@ -220,6 +242,8 @@
220 242 /* address of boot parameters */
221 243 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
222 244  
  245 + /* we have to request the gpios again after relocation */
  246 + corvus_request_gpio();
223 247 #ifdef CONFIG_CMD_NAND
224 248 corvus_nand_hw_init();
225 249 #endif
... ... @@ -249,6 +273,7 @@
249 273 return 0;
250 274 }
251 275  
  276 +#ifndef CONFIG_DM_ETH
252 277 int board_eth_init(bd_t *bis)
253 278 {
254 279 int rc = 0;
... ... @@ -257,6 +282,7 @@
257 282 #endif
258 283 return rc;
259 284 }
  285 +#endif
260 286  
261 287 /* SPI chip select control */
262 288 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
... ... @@ -289,4 +315,13 @@
289 315 break;
290 316 }
291 317 }
  318 +
  319 +static struct atmel_serial_platdata at91sam9260_serial_plat = {
  320 + .base_addr = ATMEL_BASE_DBGU,
  321 +};
  322 +
  323 +U_BOOT_DEVICE(at91sam9260_serial) = {
  324 + .name = "serial_atmel",
  325 + .platdata = &at91sam9260_serial_plat,
  326 +};
configs/corvus_defconfig
1 1 CONFIG_ARM=y
2 2 CONFIG_ARCH_AT91=y
3 3 CONFIG_TARGET_CORVUS=y
  4 +CONFIG_DEFAULT_DEVICE_TREE="at91sam9g45-corvus"
4 5 CONFIG_SPL=y
5 6 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH"
6 7 CONFIG_BOOTDELAY=3
... ... @@ -14,6 +15,8 @@
14 15 CONFIG_CMD_USB=y
15 16 CONFIG_CMD_DFU=y
16 17 # CONFIG_CMD_FPGA is not set
  18 +CONFIG_CMD_GPIO=y
  19 +# CONFIG_CMD_SOURCE is not set
17 20 # CONFIG_CMD_SETEXPR is not set
18 21 CONFIG_CMD_DHCP=y
19 22 CONFIG_CMD_PING=y
... ... @@ -25,4 +28,9 @@
25 28 CONFIG_G_DNL_VENDOR_NUM=0x0908
26 29 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
27 30 CONFIG_OF_LIBFDT=y
  31 +CONFIG_OF_CONTROL=y
  32 +CONFIG_OF_EMBED=y
  33 +CONFIG_USB=y
  34 +CONFIG_USB_GADGET=y
  35 +# CONFIG_EFI_LOADER is not set
include/configs/corvus.h
... ... @@ -35,7 +35,7 @@
35 35 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
36 36 #define CONFIG_SETUP_MEMORY_TAGS
37 37 #define CONFIG_INITRD_TAG
38   -#define CONFIG_SKIP_LOWLEVEL_INIT
  38 +#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
39 39 #define CONFIG_BOARD_EARLY_INIT_F
40 40 #define CONFIG_DISPLAY_CPUINFO
41 41