From 417eca09bf2b325bf0c6399c6b58a0692711542d Mon Sep 17 00:00:00 2001 From: Eugen Hristev Date: Tue, 5 Jan 2021 10:54:01 +0200 Subject: pinctrl: at91-pio4: implement drive strength support Implement drive strength support, by preserving the same bindings as in Linux. Signed-off-by: Eugen Hristev --- arch/arm/mach-at91/include/mach/atmel_pio4.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/arm/mach-at91/include/mach/atmel_pio4.h b/arch/arm/mach-at91/include/mach/atmel_pio4.h index f348b05bc85..35ac7b2d40e 100644 --- a/arch/arm/mach-at91/include/mach/atmel_pio4.h +++ b/arch/arm/mach-at91/include/mach/atmel_pio4.h @@ -52,6 +52,7 @@ struct atmel_pio4_port { #define ATMEL_PIO_DRVSTR_LO (1 << 16) #define ATMEL_PIO_DRVSTR_ME (2 << 16) #define ATMEL_PIO_DRVSTR_HI (3 << 16) +#define ATMEL_PIO_DRVSTR_OFFSET 16 #define ATMEL_PIO_CFGR_EVTSEL_MASK GENMASK(26, 24) #define ATMEL_PIO_CFGR_EVTSEL_FALLING (0 << 24) #define ATMEL_PIO_CFGR_EVTSEL_RISING (1 << 24) -- cgit v1.2.3 From 786f888b743e9b83c9095cb9b5548ebe2e29afc5 Mon Sep 17 00:00:00 2001 From: Tudor Ambarus Date: Fri, 8 Jan 2021 14:40:19 +0200 Subject: sama5d3: Fix Galois Field Table offsets Offsets are described in the datasheet at section: "11.4.4.2 NAND Flash Boot: PMECC Error Detection and Correction". For testing I "injected" bit flips into u-boot NAND memory area, and then read back. PMECC could not correct the errors. With the offsets updated everything is fine. Fixes: 3225f34e5c ("ARM: atmel: add sama5d3xek support") Signed-off-by: Tudor Ambarus --- arch/arm/mach-at91/include/mach/sama5d3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h index 83f18a8148f..f4f05676f72 100644 --- a/arch/arm/mach-at91/include/mach/sama5d3.h +++ b/arch/arm/mach-at91/include/mach/sama5d3.h @@ -190,8 +190,8 @@ /* * PMECC table in ROM */ -#define ATMEL_PMECC_INDEX_OFFSET_512 0x10000 -#define ATMEL_PMECC_INDEX_OFFSET_1024 0x18000 +#define ATMEL_PMECC_INDEX_OFFSET_512 0x8000 +#define ATMEL_PMECC_INDEX_OFFSET_1024 0x10000 /* * SAMA5D3 specific prototypes -- cgit v1.2.3 From 3270c47b396ed8710f1135896d97c623cfe5a207 Mon Sep 17 00:00:00 2001 From: "Kai Stuhlemmer (ebee Engineering)" Date: Fri, 8 Jan 2021 14:40:20 +0200 Subject: sam9x60.h: Fix Galois Field Table offsets Because ATMEL_BASE_ROM is defined to 0x100000, it already points to the begin of the index table for 512 byte sectors correction. Thus its offset must be zero and the index of the table for 1024 byte sectors must start at offset 0x8000. Signed-off-by: Kai Stuhlemmer (ebee Engineering) [ta: update commit message] Signed-off-by: Tudor Ambarus --- arch/arm/mach-at91/include/mach/sam9x60.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-at91/include/mach/sam9x60.h b/arch/arm/mach-at91/include/mach/sam9x60.h index b7f43226b7e..c08d19c6917 100644 --- a/arch/arm/mach-at91/include/mach/sam9x60.h +++ b/arch/arm/mach-at91/include/mach/sam9x60.h @@ -154,8 +154,8 @@ /* * PMECC table in ROM */ -#define ATMEL_PMECC_INDEX_OFFSET_512 0x8000 -#define ATMEL_PMECC_INDEX_OFFSET_1024 0x10000 +#define ATMEL_PMECC_INDEX_OFFSET_512 0x0000 +#define ATMEL_PMECC_INDEX_OFFSET_1024 0x8000 /* * SAM9X60 specific prototypes -- cgit v1.2.3 From 911980059159392231d220aa13b0a05ad5b80869 Mon Sep 17 00:00:00 2001 From: Greg Gallagher Date: Thu, 21 Jan 2021 11:55:34 -0500 Subject: board: atmel: Add SAMA5D27 giant board Giant board is a tiny SBC based on the Adafruit Feather form factor, created by groboards it contains a SAMA5D2 processor (SAMA5D27), 128 MB of RAM and a microSD card for storage. Signed-off-by: Greg Gallagher --- arch/arm/dts/Makefile | 3 +- arch/arm/dts/at91-sama5d27_giantboard.dts | 128 ++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/at91-sama5d27_giantboard.dts (limited to 'arch') diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index a9d36e0e9c8..1d4eddd20e2 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -905,7 +905,8 @@ dtb-$(CONFIG_TARGET_SAMA5D2_XPLAINED) += \ at91-sama5d2_xplained.dtb dtb-$(CONFIG_TARGET_SAMA5D27_SOM1_EK) += \ - at91-sama5d27_som1_ek.dtb + at91-sama5d27_som1_ek.dtb \ + at91-sama5d27_giantboard.dtb dtb-$(CONFIG_TARGET_SAMA5D27_WLSOM1_EK) += \ at91-sama5d27_wlsom1_ek.dtb diff --git a/arch/arm/dts/at91-sama5d27_giantboard.dts b/arch/arm/dts/at91-sama5d27_giantboard.dts new file mode 100644 index 00000000000..e81ca60ca0a --- /dev/null +++ b/arch/arm/dts/at91-sama5d27_giantboard.dts @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * at91-sama5d27_giantboard.dts - Device Tree file for Giant Board + * + * Copyright (C) 2020 Greg Gallagher + * + * Derived from at91-sama5d27_som1_ek.dts + * + * Copyright (C) 2017 Microchip Corporation + * Wenyou Yang + */ +/dts-v1/; +#include "sama5d2.dtsi" +#include "sama5d2-pinfunc.h" + +/ { + model = "Giant Board"; + compatible = "atmel,sama5d27-giantboard", "atmel,sama5d2", "atmel,sama5"; + + memory { + reg = <0x20000000 0x8000000>; + }; + + chosen { + u-boot,dm-pre-reloc; + stdout-path = &uart1; + }; + + ahb { + sdmmc1: sdio-host@b0000000 { + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sdmmc1_cmd_dat_default &pinctrl_sdmmc1_ck_cd_default>; + status = "okay"; + u-boot,dm-pre-reloc; + }; + + apb { + + uart1: serial@f8020000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart1_default>; + status = "okay"; + u-boot,dm-pre-reloc; + }; + + i2c0: i2c@f8028000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0_default>; + status = "okay"; + }; + + i2c1: i2c@fc028000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_default>; + status = "okay"; + + pmic@5b { + compatible = "active-semi,act8945a"; + reg = <0x5b>; + active-semi,vsel-low; + status = "okay"; + }; + }; + + pit: timer@f8048030 { + status = "okay"; + u-boot,dm-pre-reloc; + }; + + sfr: sfr@f8030000 { + status = "okay"; + u-boot,dm-pre-reloc; + }; + + pioA: gpio@fc038000 { + pinctrl { + + pinctrl_sdmmc1_cmd_dat_default: sdmmc1_cmd_dat_default { + pinmux = , + , + , + , + ; + bias-pull-up; + u-boot,dm-pre-reloc; + }; + + pinctrl_sdmmc1_ck_cd_default: sdmmc1_ck_cd_default { + pinmux = , + ; + bias-disable; + u-boot,dm-pre-reloc; + }; + + pinctrl_uart1_default: uart1_default { + pinmux = , + ; + bias-disable; + u-boot,dm-pre-reloc; + }; + + pinctrl_i2c0_default: i2c0_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_i2c1_default: i2c1_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_usb_default: usb_default { + pinmux = ; + bias-disable; + }; + + pinctrl_usba_vbus: usba_vbus { + pinmux = ; + bias-disable; + }; + }; + }; + }; + }; +}; -- cgit v1.2.3 From 786f35b619ddbfb88e4532d11a56413f5dab473f Mon Sep 17 00:00:00 2001 From: Greg Gallagher Date: Thu, 21 Jan 2021 11:55:36 -0500 Subject: ARM: at91: spl: add spl_early_init for sama5d2 platforms The dm root node is needed early in the spl to allow the timer to be used. This change calls spl_early_init to initialize the dm root node. Signed-off-by: Greg Gallagher --- arch/arm/mach-at91/spl_atmel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c index 23588e79f94..217ed12e31e 100644 --- a/arch/arm/mach-at91/spl_atmel.c +++ b/arch/arm/mach-at91/spl_atmel.c @@ -103,6 +103,13 @@ void board_init_f(ulong dummy) { int ret; + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + ret = spl_early_init(); + if (ret) { + debug("spl_early_init() failed: %d\n", ret); + hang(); + } + } switch_to_main_crystal_osc(); #ifdef CONFIG_SAMA5D2 -- cgit v1.2.3