Add support for sam9x60ek
Subsystems (6)
v3 cover Add support for sam9x60ek
From: Tudor Ambarus <[email protected]>
Add support for sam9x60 SOC, sam9x60ek board, dts, NAND and QSPI. Add defconfigs for MMC, NAND and QSPI.
v3:
- Enable MII utility commands and phy in qspi & nand defconfigs
- Add sam9x60-sdhci and sam9x60-macb compatibility strings
- nandflash_defconfig: Fix rootfs partition
v2: add maintainers for qspi & nand defconfigs
Nicolas Ferre (2):
net: macb: Add sam9x60-macb compatibility string
ARM: dts: at91: sam9x60: Add macb0 Ethernet controller
Sandeep Sheriker Mallikarjun (5):
mmc: atmel_sdhci: Add sam9x60-sdhci compatibility string
ARM: at91: Add sam9x60 soc
ARM: dts: Add dts files for sam9x60ek
board: atmel: Add sam9x60ek board
configs: Add sam9x60ek_mmc_defconfig
Tudor Ambarus (7):
ARM: at91: Rename sama5_sfr.h to at91_sfr.h
ARM: at91: Add SFR definitions
board: sam9x60ek: Add NAND flash support
configs: Add sam9x60ek_nandflash_defconfig
configs: sam9x60ek: Add QSPI_BOOT defines
ARM: dts: at91: sam9x60ek: Enable qspi node
configs: Add sam9x60ek_qspiflash_defconfig
arch/arm/dts/Makefile | 2 +
arch/arm/dts/sam9x60.dtsi | 285 +++++++++++++++++++++
arch/arm/dts/sam9x60ek-u-boot.dtsi | 132 ++++++++++
arch/arm/dts/sam9x60ek.dts | 55 ++++
arch/arm/mach-at91/Kconfig | 11 +
arch/arm/mach-at91/arm926ejs/Makefile | 1 +
arch/arm/mach-at91/arm926ejs/sam9x60_devices.c | 125 +++++++++
arch/arm/mach-at91/armv7/sama5d4_devices.c | 2 +-
arch/arm/mach-at91/atmel_sfr.c | 2 +-
.../include/mach/{sama5_sfr.h => at91_sfr.h} | 52 +++-
arch/arm/mach-at91/include/mach/hardware.h | 2 +
arch/arm/mach-at91/include/mach/sam9x60.h | 169 ++++++++++++
board/atmel/sam9x60ek/Kconfig | 12 +
board/atmel/sam9x60ek/MAINTAINERS | 9 +
board/atmel/sam9x60ek/Makefile | 7 +
board/atmel/sam9x60ek/sam9x60ek.c | 120 +++++++++
board/laird/wb50n/wb50n.c | 2 +-
configs/sam9x60ek_mmc_defconfig | 52 ++++
configs/sam9x60ek_nandflash_defconfig | 53 ++++
configs/sam9x60ek_qspiflash_defconfig | 75 ++++++
drivers/clk/at91/clk-utmi.c | 2 +-
drivers/mmc/atmel_sdhci.c | 1 +
drivers/net/macb.c | 1 +
include/configs/sam9x60ek.h | 95 +++++++
24 files changed, 1258 insertions(+), 9 deletions(-)
create mode 100644 arch/arm/dts/sam9x60.dtsi
create mode 100644 arch/arm/dts/sam9x60ek-u-boot.dtsi
create mode 100644 arch/arm/dts/sam9x60ek.dts
create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x60_devices.c
rename arch/arm/mach-at91/include/mach/{sama5_sfr.h => at91_sfr.h} (53%)
create mode 100644 arch/arm/mach-at91/include/mach/sam9x60.h
create mode 100644 board/atmel/sam9x60ek/Kconfig
create mode 100644 board/atmel/sam9x60ek/MAINTAINERS
create mode 100644 board/atmel/sam9x60ek/Makefile
create mode 100644 board/atmel/sam9x60ek/sam9x60ek.c
create mode 100644 configs/sam9x60ek_mmc_defconfig
create mode 100644 configs/sam9x60ek_nandflash_defconfig
create mode 100644 configs/sam9x60ek_qspiflash_defconfig
create mode 100644 include/configs/sam9x60ek.hSignature · 1 line
2.9.5
PATCH v3 1/14 net: macb: Add sam9x60-macb compatibility string
From: Nicolas Ferre <[email protected]>
Add this new compatibility string for matching sam9x60 product macb.
--- drivers/net/macb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/macb.c +1 -0
@@ -1319,6 +1319,7 @@ static const struct macb_config sifive_config = {static const struct udevice_id macb_eth_ids[] = { { .compatible ="cdns,macb" }, { .compatible ="cdns,at91sam9260-macb" }, + { .compatible ="cdns,sam9x60-macb" }, { .compatible ="atmel,sama5d2-gem" }, { .compatible ="atmel,sama5d3-gem" }, { .compatible ="atmel,sama5d4-gem" , .data = (ulong)&sama5d4_config },
Signature · 1 line
2.9.5
PATCH v3 2/14 mmc: atmel_sdhci: Add sam9x60-sdhci compatibility string
In reply to Tudor.Ambarus at microchip.comFrom: Sandeep Sheriker Mallikarjun <[email protected]>
Add new compatibility string for matching sam9x60 product.
--- drivers/mmc/atmel_sdhci.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/atmel_sdhci.c +1 -0
@@ -112,6 +112,7 @@ static int atmel_sdhci_bind(struct udevice *dev)static const struct udevice_id atmel_sdhci_ids[] = { { .compatible ="atmel,sama5d2-sdhci" }, + { .compatible ="microchip,sam9x60-sdhci" }, { } };
Signature · 1 line
2.9.5
PATCH v3 3/14 ARM: at91: Add sam9x60 soc
In reply to Tudor.Ambarus at microchip.comFrom: Sandeep Sheriker Mallikarjun <[email protected]>
Add new Microchip sam9x60 SoC based on an ARM926.
--- arch/arm/mach-at91/Kconfig | 4 + arch/arm/mach-at91/arm926ejs/Makefile | 1 + arch/arm/mach-at91/arm926ejs/sam9x60_devices.c | 125 ++++++++++++++++++ arch/arm/mach-at91/include/mach/hardware.h | 2 + arch/arm/mach-at91/include/mach/sam9x60.h | 169 +++++++++++++++++++++++++ 5 files changed, 301 insertions(+) create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x60_devices.c create mode 100644 arch/arm/mach-at91/include/mach/sam9x60.h
arch/arm/mach-at91/Kconfig +4 -0
@@ -43,6 +43,10 @@ config AT91SAM9X5 bool select CPU_ARM926EJS +config SAM9X60 + bool + select CPU_ARM926EJS + config SAMA5D2 bool select CPU_V7A
arch/arm/mach-at91/arm926ejs/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o obj-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o obj-$(CONFIG_AT91SAM9N12) += at91sam9n12_devices.o obj-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o +obj-$(CONFIG_SAM9X60) += sam9x60_devices.o obj-$(CONFIG_AT91_EFLASH) += eflash.o obj-$(CONFIG_AT91_LED) += led.o obj-y += clock.o
arch/arm/mach-at91/arm926ejs/sam9x60_devices.c new file +125 -0
125 lines not on this page · raw message
arch/arm/mach-at91/include/mach/hardware.h +2 -0
@@ -22,6 +22,8 @@# include <asm/arch/at91sam9g45.h> #elif defined(CONFIG_AT91SAM9N12 ) || defined(CONFIG_AT91SAM9X5 )# include <asm/arch/at91sam9x5.h> +#elif defined(CONFIG_SAM9X60 ) +# include <asm/arch/sam9x60.h> #elif defined(CONFIG_SAMA5D2 )# include <asm/arch/sama5d2.h> #elif defined(CONFIG_SAMA5D3 )
arch/arm/mach-at91/include/mach/sam9x60.h new file +169 -0
169 lines not on this page · raw message
Signature · 1 line
2.9.5
PATCH v3 4/14 ARM: dts: Add dts files for sam9x60ek
In reply to Tudor.Ambarus at microchip.comFrom: Sandeep Sheriker Mallikarjun <[email protected]>
add device tree files for sam9x60ek board with below changes.
- Add initial device nodes (pmc, pinctrl, sdhc, dbgu & pit)
- Add the reg property for the pinctrl node.
- Add the "u-boot,dm-pre-reloc" property to determine which nodes are used by the board_init_f stage.
[nicolas.ferre at microchip.com:
- fix gclk,
- fix pio/pinctrl controller definition and allow to have more than only PIOA for this SoC,
- removing pinctrl address]
[claudiu.beznea at microchip.com:
- use SAM9X60's compatible for pinctrl
- add drive strength and slew rate options for SDMMC0 pins.]
[tudor.ambarus at microchip.com:
- u-boot,dm-pre-reloc property in dedicated file,
- fix pit len, starts from 0xFFFFFE40 and it is of len 0x10]
--- arch/arm/dts/Makefile | 2 + arch/arm/dts/sam9x60.dtsi | 225 +++++++++++++++++++++++++++++++++++++ arch/arm/dts/sam9x60ek-u-boot.dtsi | 104 +++++++++++++++++ arch/arm/dts/sam9x60ek.dts | 19 ++++ 4 files changed, 350 insertions(+) create mode 100644 arch/arm/dts/sam9x60.dtsi create mode 100644 arch/arm/dts/sam9x60ek-u-boot.dtsi create mode 100644 arch/arm/dts/sam9x60ek.dts
arch/arm/dts/Makefile +2 -0
@@ -690,6 +690,8 @@ dtb-$(CONFIG_TARGET_AT91SAM9X5EK) += \ at91sam9x25ek.dtb \ at91sam9x35ek.dtb +dtb-$(CONFIG_TARGET_SAM9X60EK) += sam9x60ek.dtb + dtb-$(CONFIG_TARGET_AT91SAM9N12EK) += at91sam9n12ek.dtb dtb-$(CONFIG_TARGET_GARDENA_SMART_GATEWAY_AT91SAM) += \
arch/arm/dts/sam9x60.dtsi new file +225 -0
225 lines not on this page · raw message
arch/arm/dts/sam9x60ek-u-boot.dtsi new file +104 -0
104 lines not on this page · raw message
arch/arm/dts/sam9x60ek.dts new file +19 -0
@@ -0,0 +1,19 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * sam9x60ek.dts - Device Tree file for SAM9X60 EK board + * + * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries + * + * Author: Sandeep Sheriker M <[email protected]> + */ +/dts-v1/; +#include "sam9x60.dtsi" + +/ { + model = "Microchip SAM9X60-Ek"; + compatible = "microchip,sam9x60ek", "microchip,sam9x60", "atmel,at91sam9"; + + chosen { + stdout-path = &dbgu; + }; +};
Signature · 1 line
2.9.5
PATCH v3 5/14 ARM: dts: at91: sam9x60: Add macb0 Ethernet controller
In reply to Tudor.Ambarus at microchip.comFrom: Nicolas Ferre <[email protected]>
Add Ethernet controller to dtsi file and enable it on sam9x60ek platform connected with rmii.
--- arch/arm/dts/sam9x60.dtsi | 31 +++++++++++++++++++++++++++++++ arch/arm/dts/sam9x60ek.dts | 5 +++++ 2 files changed, 36 insertions(+)
arch/arm/dts/sam9x60.dtsi +31 -0
@@ -60,6 +60,16 @@ #size-cells = <1>; ranges; + macb0: ethernet at f802c000 { + compatible = "cdns,sam9x60-macb", "cdns,macb"; + reg = <0xf802c000 0x100>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_macb0_rmii>; + clock-names = "hclk", "pclk"; + clocks = <&macb0_clk>, <&macb0_clk>; + status = "disabled"; + }; + dbgu: serial at fffff200 { compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; reg = <0xfffff200 0x200>;
@@ -88,6 +98,22 @@ }; }; + macb0 { + pinctrl_macb0_rmii: macb0_rmii-0 { + atmel,pins = + <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB0 periph A */ + AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB1 periph A */ + AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB2 periph A */ + AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB3 periph A */ + AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB4 periph A */ + AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB5 periph A */ + AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB6 periph A */ + AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB7 periph A */ + AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB9 periph A */ + AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB10 periph A */ + }; + }; + sdhci0 { pinctrl_sdhci0: sdhci0 { atmel,pins =
@@ -171,6 +197,11 @@ #clock-cells = <0>; reg = <47>; }; + + macb0_clk: macb0_clk { + #clock-cells = <0>; + reg = <24>; + }; }; generic: gck {
arch/arm/dts/sam9x60ek.dts +5 -0
@@ -17,3 +17,8 @@ stdout-path = &dbgu; }; }; + +&macb0 { + phy-mode = "rmii"; + status = "okay"; +};
Signature · 1 line
2.9.5
PATCH v3 6/14 board: atmel: Add sam9x60ek board
In reply to Tudor.Ambarus at microchip.comFrom: Sandeep Sheriker Mallikarjun <[email protected]>
Add new board SAM9X60-EK using the ARM926 SAM9X60 SoC.
[tudor.ambarus at microchip.com:
- fix number of DRAM banks:
One DDR2-SDRAM (W972GG6KB 2 Gbit = 16 Mbit x 16 x 8 banks]
- drop SPL related macros
- drop memtest macros
- drop CONFIG_SPI_BOOT, CONFIG_SYS_USE_DATAFLASH related macros
- drop inclusion of asm/arch/at91sam9_smc.h]
--- arch/arm/mach-at91/Kconfig | 7 +++++ board/atmel/sam9x60ek/Kconfig | 12 ++++++++ board/atmel/sam9x60ek/MAINTAINERS | 7 +++++ board/atmel/sam9x60ek/Makefile | 7 +++++ board/atmel/sam9x60ek/sam9x60ek.c | 59 ++++++++++++++++++++++++++++++++++++++ include/configs/sam9x60ek.h | 60 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 152 insertions(+) create mode 100644 board/atmel/sam9x60ek/Kconfig create mode 100644 board/atmel/sam9x60ek/MAINTAINERS create mode 100644 board/atmel/sam9x60ek/Makefile create mode 100644 board/atmel/sam9x60ek/sam9x60ek.c create mode 100644 include/configs/sam9x60ek.h
arch/arm/mach-at91/Kconfig +7 -0
@@ -160,6 +160,12 @@ config TARGET_GARDENA_SMART_GATEWAY_AT91SAM select BOARD_LATE_INIT select SUPPORT_SPL +config TARGET_SAM9X60EK + bool "SAM9X60-EK board" + select SAM9X60 + select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT + config TARGET_SAMA5D2_PTC_EK bool "SAMA5D2 PTC EK board" select BOARD_EARLY_INIT_F
@@ -316,6 +322,7 @@ source "board/atmel/at91sam9m10g45ek/Kconfig" source "board/atmel/at91sam9n12ek/Kconfig" source "board/atmel/at91sam9rlek/Kconfig" source "board/atmel/at91sam9x5ek/Kconfig" +source "board/atmel/sam9x60ek/Kconfig" source "board/atmel/sama5d2_ptc_ek/Kconfig" source "board/atmel/sama5d2_xplained/Kconfig" source "board/atmel/sama5d27_som1_ek/Kconfig"
board/atmel/sam9x60ek/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_SAM9X60EK + +config SYS_BOARD + default "sam9x60ek" + +config SYS_VENDOR + default "atmel" + +config SYS_CONFIG_NAME + default "sam9x60ek" + +endif
board/atmel/sam9x60ek/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +SAM9X60EK BOARD +M: Sandeep Sheriker M <[email protected]> +M: Eugen Hristev <[email protected]> +S: Maintained +F: board/atmel/sam9x60ek/ +F: include/configs/sam9x60ek.h +F: configs/sam9x60ek_mmc_defconfig
board/atmel/sam9x60ek/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries +# +# Author: Sandeep Sheriker M <[email protected]> + +obj-y += sam9x60ek.o
board/atmel/sam9x60ek/sam9x60ek.c new file +59 -0
59 lines not on this page · raw message
include/configs/sam9x60ek.h new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
2.9.5
PATCH v3 7/14 configs: Add sam9x60ek_mmc_defconfig
In reply to Tudor.Ambarus at microchip.comFrom: Sandeep Sheriker Mallikarjun <[email protected]>
add sam9x60ek_mmc_defconfig and for now only supports booting from sdcard.
[nicolas.ferre at microchip.com: split patch, add Ethernet controller, phy and tools]
[tudor.ambarus at microchip.com: Fix number of DRAM banks:
One DDR2-SDRAM (W972GG6KB 2 Gbit = 16 Mbit x 16 x 8 banks]
--- configs/sam9x60ek_mmc_defconfig | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 configs/sam9x60ek_mmc_defconfig
configs/sam9x60ek_mmc_defconfig new file +52 -0
@@ -0,0 +1,52 @@ +CONFIG_ARM=y +CONFIG_ARCH_AT91=y +CONFIG_SYS_TEXT_BASE=0x23f00000 +CONFIG_TARGET_SAM9X60EK=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_ENV_SIZE=0x4000 +CONFIG_NR_DRAM_BANKS=8 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_BASE=0xfffff200 +CONFIG_DEBUG_UART_CLOCK=200000000 +CONFIG_DEBUG_UART=y +CONFIG_FIT=y +CONFIG_SD_BOOT=y +CONFIG_BOOTDELAY=3 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="mem=256M console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait" +CONFIG_SYS_CONSOLE_IS_IN_ENV=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_MMC=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="sam9x60ek" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_DM=y +CONFIG_CLK=y +CONFIG_CLK_AT91=y +CONFIG_AT91_GENERIC_CLK=y +CONFIG_DM_GPIO=y +CONFIG_AT91_GPIO=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ATMEL=y +CONFIG_PHY_MICREL=y +CONFIG_DM_ETH=y +CONFIG_MACB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_AT91=y +CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_ATMEL_USART=y +CONFIG_TIMER=y +CONFIG_ATMEL_PIT_TIMER=y +CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.9.5
PATCH v3 8/14 ARM: at91: Rename sama5_sfr.h to at91_sfr.h
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
The Special Function Registers (SFR) are present in sam9x5 and sam9x60 too, rename sama5_sfr to at91_sfr.h.
---
arch/arm/mach-at91/armv7/sama5d4_devices.c | 2 +-
arch/arm/mach-at91/atmel_sfr.c | 2 +-
arch/arm/mach-at91/include/mach/{sama5_sfr.h => at91_sfr.h} | 4 ++--
board/laird/wb50n/wb50n.c | 2 +-
drivers/clk/at91/clk-utmi.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
rename arch/arm/mach-at91/include/mach/{sama5_sfr.h => at91_sfr.h} (97%)arch/arm/mach-at91/armv7/sama5d4_devices.c +1 -1
@@ -8,7 +8,7 @@#include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/clk.h> -#include <asm/arch/sama5_sfr.h> +#include <asm/arch/at91_sfr.h> #include <asm/arch/sama5d4.h> char *get_cpu_name ()
arch/arm/mach-at91/atmel_sfr.c +1 -1
@@ -7,7 +7,7 @@#include <common.h> #include <asm/hardware.h> #include <asm/io.h> -#include <asm/arch/sama5_sfr.h> +#include <asm/arch/at91_sfr.h> #if defined(CONFIG_SAMA5D2 ) || defined(CONFIG_SAMA5D4 )void redirect_int_from_saic_to_aic (void )
arch/arm/mach-at91/include/mach/at91_sfr.h renamed from arch/arm/mach-at91/include/mach/sama5_sfr.h +2 -2
@@ -6,8 +6,8 @@* Bo Shen <[email protected]> */ -#ifndef __SAMA5_SFR_H -#define __SAMA5_SFR_H +#ifndef __AT91_SFR_H +#define __AT91_SFR_H struct atmel_sfr { u32 reserved1; /* 0x00 */
board/laird/wb50n/wb50n.c +1 -1
@@ -4,7 +4,7 @@#include <common.h> #include <asm/io.h> -#include <asm/arch/sama5_sfr.h> +#include <asm/arch/at91_sfr.h> #include <asm/arch/sama5d3_smc.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_pmc.h>
drivers/clk/at91/clk-utmi.c +1 -1
@@ -10,7 +10,7 @@#include <syscon.h> #include <linux/io.h> #include <mach/at91_pmc.h> -#include <mach/sama5_sfr.h> +#include <mach/at91_sfr.h> #include "pmc.h" /*
Signature · 1 line
2.9.5
PATCH v3 9/14 ARM: at91: Add SFR definitions
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
sama5's SFR has at offset 0x04 the DDR Configuration Register, while sam9x60's SFR contains the EBI Chip Select Register. Add a union to reconcile both boards.
--- arch/arm/mach-at91/include/mach/at91_sfr.h | 48 ++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-)
arch/arm/mach-at91/include/mach/at91_sfr.h +45 -3
@@ -11,7 +11,10 @@struct atmel_sfr {u32 reserved1;/* 0x00 */ -u32 ddrcfg;/* 0x04: DDR Configuration Register */ +union { +u32 ddrcfg;/* 0x04: DDR Configuration Register */ +u32 ebicsa;/* 0x04: EBI Chip Select Register */ + };u32 reserved2;/* 0x08 */ u32 reserved3;/* 0x0c */ u32 ohciicr;/* 0x10: OHCI Interrupt Configuration Register */
@@ -28,7 +31,16 @@ struct atmel_sfr { };/* Register Mapping*/ +#define AT91_SFR_DDRCFG 0x04/* DDR Configuration Register */ +#define AT91_SFR_CCFG_EBICSA 0x04/* EBI Chip Select Register */ +/* 0x08 ~ 0x0c: Reserved */ +#define AT91_SFR_OHCIICR 0x10/* OHCI INT Configuration Register */ +#define AT91_SFR_OHCIISR 0x14/* OHCI INT Status Register */ #define AT91_SFR_UTMICKTRIM 0x30/* UTMI Clock Trimming Register */ +#define AT91_SFR_UTMISWAP 0x3c/* UTMI DP/DM Pin Swapping Register */ +#define AT91_SFR_LS 0x7c/* Light Sleep Register */ +#define AT91_SFR_I2SCLKSEL 0x90/* I2SC Register */ +#define AT91_SFR_WPMR 0xe4/* Write Protection Mode Register */ /* Bit field in DDRCFG */ #define ATMEL_SFR_DDRCFG_FDQIEN 0x00010000
@@ -58,9 +70,39 @@ struct atmel_sfr {#define AT91_SFR_EBICFG_SCH1_OFF (0x0 << 12)#define AT91_SFR_EBICFG_SCH1_ON (0x1 << 12) -#define AT91_UTMICKTRIM_FREQ GENMASK(1, 0) -/* Bit field in AICREDIR */ #define ATMEL_SFR_AICREDIR_NSAIC 0x00000001 +/* Bit field in DDRCFG */ +#define ATMEL_SFR_DDRCFG_FDQIEN 0x00010000 +#define ATMEL_SFR_DDRCFG_FDQSIEN 0x00020000 + +#define AT91_SFR_CCFG_EBI_CSA (cs, val) ((val) << (cs)) +#define AT91_SFR_CCFG_EBI_DBPUC BIT(8) +#define AT91_SFR_CCFG_EBI_DBPDC BIT(9) +#define AT91_SFR_CCFG_EBI_DRIVE_SAM9X60 BIT(16) +#define AT91_SFR_CCFG_EBI_DRIVE BIT(17) +#define AT91_SFR_CCFG_DQIEN_F BIT(20) +#define AT91_SFR_CCFG_NFD0_ON_D16 BIT(24) +#define AT91_SFR_CCFG_DDR_MP_EN BIT(25) + +#define AT91_SFR_OHCIICR_RES (x) BIT(x) +#define AT91_SFR_OHCIICR_ARIE BIT(4) +#define AT91_SFR_OHCIICR_APPSTART BIT(5) +#define AT91_SFR_OHCIICR_USB_SUSP (x) BIT(8 + (x)) +#define AT91_SFR_OHCIICR_UDPPUDIS BIT(23) +#define AT91_OHCIICR_USB_SUSPEND GENMASK(10, 8) + +#define AT91_SFR_OHCIISR_RIS (x) BIT(x) + +#define AT91_UTMICKTRIM_FREQ GENMASK(1, 0) + +#define AT91_SFR_UTMISWAP_PORT (x) BIT(x) + +#define AT91_SFR_LS_VALUE (x) BIT(x) +#define AT91_SFR_LS_MEM_POWER_GATING_ULP1_EN BIT(16) + +#define AT91_SFR_WPMR_WPEN BIT(0) +#define AT91_SFR_WPMR_WPKEY_MASK GENMASK(31, 8) +#endif
Signature · 1 line
2.9.5
PATCH v3 10/14 board: sam9x60ek: Add NAND flash support
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
- EBI Chip Select Register is now in SFR,
- the pins are set to default values,
- timings are matching MT29F4G08BABWP's nand flash requirements.
--- board/atmel/sam9x60ek/sam9x60ek.c | 61 +++++++++++++++++++++++++++++++++++++++ include/configs/sam9x60ek.h | 28 ++++++++++++++++++ 2 files changed, 89 insertions(+)
board/atmel/sam9x60ek/sam9x60ek.c +61 -0
@@ -7,8 +7,10 @@#include <common.h> #include <asm/io.h> +#include <asm/arch/at91sam9_smc.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_rstc.h> +#include <asm/arch/at91_sfr.h> #include <asm/arch/clk.h> #include <asm/arch/gpio.h> #include <debug_uart.h>
@@ -18,6 +20,62 @@ DECLARE_GLOBAL_DATA_PTR;void at91_prepare_cpu_var (void ); +#ifdef CONFIG_CMD_NAND +static void sam9x60ek_nand_hw_init(void) +{ + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; + struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR; + unsigned int csa; + + at91_pio3_set_a_periph(AT91_PIO_PORTD, 0, 1); /* NAND OE */ + at91_pio3_set_a_periph(AT91_PIO_PORTD, 1, 1); /* NAND WE */ + at91_pio3_set_a_periph(AT91_PIO_PORTD, 2, 0); /* NAND ALE */ + at91_pio3_set_a_periph(AT91_PIO_PORTD, 3, 0); /* NAND CLE */ + /* Enable NandFlash */ + at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); + /* Configure RDY/BSY */ + at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 6, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 7, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 8, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 9, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 10, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 11, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 12, 1); + at91_pio3_set_a_periph(AT91_PIO_PORTD, 13, 1); + + at91_periph_clk_enable(ATMEL_ID_PIOD); + + /* Enable CS3 */ + csa = readl(&sfr->ebicsa); + csa |= AT91_SFR_CCFG_EBI_CSA(3, 1) | AT91_SFR_CCFG_NFD0_ON_D16; + + /* Configure IO drive */ + csa &= ~AT91_SFR_CCFG_EBI_DRIVE_SAM9X60; + + writel(csa, &sfr->ebicsa); + + /* Configure SMC CS3 for NAND/SmartMedia */ + writel(AT91_SMC_SETUP_NWE(4), &smc->cs[3].setup); + + writel(AT91_SMC_PULSE_NWE(10) | AT91_SMC_PULSE_NCS_WR(20) | + AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(20), + &smc->cs[3].pulse); + + writel(AT91_SMC_CYCLE_NWE(20) | AT91_SMC_CYCLE_NRD(20), + &smc->cs[3].cycle); + + writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | +#ifdef CONFIG_SYS_NAND_DBW_16 + AT91_SMC_MODE_DBW_16 | +#else /* CONFIG_SYS_NAND_DBW_8 */ + AT91_SMC_MODE_DBW_8 | +#endif + AT91_SMC_MODE_TDF | AT91_SMC_MODE_TDF_CYCLE(15), + &smc->cs[3].mode); +} +#endif + #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) {
@@ -48,6 +106,9 @@ int board_init(void)/* address of boot parameters */ gd->bd->bi_boot_params =CONFIG_SYS_SDRAM_BASE +0x100 ; +#ifdef CONFIG_CMD_NAND +sam9x60ek_nand_hw_init (); +#endif return 0 ; }
include/configs/sam9x60ek.h +28 -0
@@ -42,6 +42,26 @@#define CONFIG_SYS_INIT_SP_ADDR \ (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE) +/* NAND flash */ +#ifdef CONFIG_CMD_NAND +#define CONFIG_NAND_ATMEL +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_SYS_NAND_BASE 0x40000000 +#define CONFIG_SYS_NAND_MASK_ALE BIT(21) +#define CONFIG_SYS_NAND_MASK_CLE BIT(22) +#define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PD4 +#define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PD5 +#define CONFIG_SYS_NAND_ONFI_DETECTION + +#define CONFIG_MTD_DEVICE +#endif + +/* PMECC & PMERRLOC */ +#define CONFIG_ATMEL_NAND_HWECC +#define CONFIG_ATMEL_NAND_HW_PMECC +#define CONFIG_PMECC_CAP 8 +#define CONFIG_PMECC_SECTOR_SIZE 512 +#define CONFIG_SYS_LOAD_ADDR 0x22000000/* load address */ #ifdef CONFIG_SD_BOOT
@@ -50,6 +70,14 @@"fatload mmc 0:1 0x21000000 at91-sam9x60ek.dtb;" \"fatload mmc 0:1 0x22000000 zImage;" \ "bootz 0x22000000 - 0x21000000" + +#elif defined(CONFIG_NAND_BOOT ) +/* bootstrap + u-boot + env + linux in nandflash */ +#define CONFIG_ENV_OFFSET_REDUND 0x100000 +#define CONFIG_BOOTCOMMAND "nand read " \ + "0x22000000 0x200000 0x600000; " \ + "nand read 0x21000000 0x180000 0x20000; " \ + "bootz 0x22000000 - 0x21000000"#endif /*
Signature · 1 line
2.9.5
PATCH v3 11/14 configs: Add sam9x60ek_nandflash_defconfig
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
Boot from nand flash.
--- board/atmel/sam9x60ek/MAINTAINERS | 1 + configs/sam9x60ek_nandflash_defconfig | 53 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 configs/sam9x60ek_nandflash_defconfig
board/atmel/sam9x60ek/MAINTAINERS +1 -0
@@ -5,3 +5,4 @@ S: Maintained F: board/atmel/sam9x60ek/ F: include/configs/sam9x60ek.h F: configs/sam9x60ek_mmc_defconfig +F: configs/sam9x60ek_nandflash_defconfig
configs/sam9x60ek_nandflash_defconfig new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.9.5
PATCH v3 12/14 configs: sam9x60ek: Add QSPI_BOOT defines
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
Cope with the offsets defined at:
https://www.at91.com/linux4sam/pub/Linux4SAM/SambaSubsections/demo_nandflash_map_lnx4sam6x.png
The environment starts at 0x140000 and it's of size 0x20000. The device tree starts at 0x180000 and it's of size 0x80000. The zImage starts at 0x200000 and it's of size 0x600000.
--- include/configs/sam9x60ek.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/configs/sam9x60ek.h +7 -0
@@ -78,6 +78,13 @@"0x22000000 0x200000 0x600000; " \"nand read 0x21000000 0x180000 0x20000; " \ "bootz 0x22000000 - 0x21000000" + +#elif defined(CONFIG_QSPI_BOOT ) +/* bootstrap + u-boot + env + linux in SPI NOR flash */ +#define CONFIG_BOOTCOMMAND "sf probe 0; " \ + "sf read 0x21000000 0x180000 0x80000; " \ + "sf read 0x22000000 0x200000 0x600000; " \ + "bootz 0x22000000 - 0x21000000"#endif /*
Signature · 1 line
2.9.5
PATCH v3 13/14 ARM: dts: at91: sam9x60ek: Enable qspi node
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
The sam9x60 qspi controller uses 2 clocks, one for the peripheral register access, the other for the qspi core and phy. Both are mandatory.
Enable the qspi node together with the SST26VF064B qspi nor flash memory. Booting from the QSPI NOR flash is now possible.
--- arch/arm/dts/sam9x60.dtsi | 29 +++++++++++++++++++++++++++++ arch/arm/dts/sam9x60ek-u-boot.dtsi | 28 ++++++++++++++++++++++++++++ arch/arm/dts/sam9x60ek.dts | 31 +++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+)
arch/arm/dts/sam9x60.dtsi +29 -0
@@ -22,6 +22,7 @@ serial0 = &dbgu; gpio0 = &pioA; gpio1 = &pioB; + spi0 = &qspi; }; clocks {
@@ -60,6 +61,17 @@ #size-cells = <1>; ranges; + qspi: spi at f0014000 { + compatible = "microchip,sam9x60-qspi"; + reg = <0xf0014000 0x100>, <0x70000000 0x10000000>; + reg-names = "qspi_base", "qspi_mmap"; + clocks = <&qspi_clk>, <&qspick>; + clock-names = "pclk", "qspick"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + macb0: ethernet at f802c000 { compatible = "cdns,sam9x60-macb", "cdns,macb"; reg = <0xf802c000 0x100>;
@@ -172,6 +184,18 @@ atmel,clk-divisors = <1 2 4 6>; }; + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #address-cells = <1>; + #size-cells = <0>; + + qspick: qspick { + #clock-cells = <0>; + reg = <19>; + clocks = <&mck>; + }; + }; + periph: periphck { compatible = "microchip,sam9x60-clk-peripheral"; #address-cells = <1>;
@@ -202,6 +226,11 @@ #clock-cells = <0>; reg = <24>; }; + + qspi_clk: qspi_clk { + #clock-cells = <0>; + reg = <35>; + }; }; generic: gck {
arch/arm/dts/sam9x60ek-u-boot.dtsi +28 -0
@@ -31,6 +31,10 @@ u-boot,dm-pre-reloc; }; +&qspi { + u-boot,dm-pre-reloc; +}; + &pinctrl_dbgu { u-boot,dm-pre-reloc; };
@@ -39,10 +43,18 @@ u-boot,dm-pre-reloc; }; +&pinctrl_qspi { + u-boot,dm-pre-reloc; +}; + &pioA { u-boot,dm-pre-reloc; }; +&pioB { + u-boot,dm-pre-reloc; +}; + &pmc { u-boot,dm-pre-reloc; };
@@ -59,6 +71,14 @@ u-boot,dm-pre-reloc; }; +&system { + u-boot,dm-pre-reloc; +}; + +&qspick { + u-boot,dm-pre-reloc; +}; + &periph { u-boot,dm-pre-reloc; };
@@ -67,6 +87,10 @@ u-boot,dm-pre-reloc; }; +&pioB_clk { + u-boot,dm-pre-reloc; +}; + &sdhci0_clk { u-boot,dm-pre-reloc; };
@@ -75,6 +99,10 @@ u-boot,dm-pre-reloc; }; +&qspi_clk { + u-boot,dm-pre-reloc; +}; + &generic { u-boot,dm-pre-reloc; };
arch/arm/dts/sam9x60ek.dts +31 -0
@@ -16,6 +16,37 @@ chosen { stdout-path = &dbgu; }; + + ahb { + apb { + qspi: spi at f0014000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qspi>; + status = "okay"; + + nor_flash: sst26vf064 at 0 { + compatible = "spi-flash"; + reg = <0>; + spi-max-frequency = <80000000>; + spi-rx-bus-width = <4>; + spi-tx-bus-width = <4>; + }; + }; + + pinctrl { + pinctrl_qspi: qspi { + atmel,pins = + <AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_NONE + AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE + AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_PULL_UP + AT91_PIOB 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP + AT91_PIOB 23 AT91_PERIPH_A AT91_PINCTRL_PULL_UP + AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; + }; + + }; + }; + }; }; &macb0 {
Signature · 1 line
2.9.5
PATCH v3 14/14 configs: Add sam9x60ek_qspiflash_defconfig
In reply to Tudor.Ambarus at microchip.comFrom: Tudor Ambarus <[email protected]>
Boot from QSPI nor flash.
The at91bootstrap, u-boot, u-boot env redundant, u-boot env, device tree and kernel will reside in the QSPI nor flash. The rootfs will reside in the NAND flash.
--- board/atmel/sam9x60ek/MAINTAINERS | 1 + configs/sam9x60ek_qspiflash_defconfig | 75 +++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 configs/sam9x60ek_qspiflash_defconfig
board/atmel/sam9x60ek/MAINTAINERS +1 -0
@@ -6,3 +6,4 @@ F: board/atmel/sam9x60ek/ F: include/configs/sam9x60ek.h F: configs/sam9x60ek_mmc_defconfig F: configs/sam9x60ek_nandflash_defconfig +F: configs/sam9x60ek_qspiflash_defconfig
configs/sam9x60ek_qspiflash_defconfig new file +75 -0
75 lines not on this page · raw message
Signature · 1 line
2.9.5
v3 cover Add support for sam9x60ek
In reply to Tudor.Ambarus at microchip.comApplied this series to u-boot-atmel/next, thanks !
Quoted 72 lines · On 27.09.2019 16:08, Tudor Ambarus - M18064 wrote:
From: Tudor Ambarus <[email protected]>
Add support for sam9x60 SOC, sam9x60ek board, dts, NAND and QSPI. Add defconfigs for MMC, NAND and QSPI.
v3:
- Enable MII utility commands and phy in qspi & nand defconfigs
- Add sam9x60-sdhci and sam9x60-macb compatibility strings
-nandflash_defconfig: Fix rootfs partitionv2: add maintainers for qspi & nand defconfigs
Nicolas Ferre (2):
net: macb: Add sam9x60-macb compatibility string
ARM: dts: at91: sam9x60: Add macb0 Ethernet controllerSandeep Sheriker Mallikarjun (5):
mmc:atmel_sdhci: Add sam9x60-sdhci compatibility string
ARM: at91: Add sam9x60 soc
ARM: dts: Add dts files for sam9x60ek
board: atmel: Add sam9x60ek board
configs: Addsam9x60ek_mmc_defconfigTudor Ambarus (7):
ARM: at91: Renamesama5_sfr.htoat91_sfr.h
ARM: at91: Add SFR definitions
board: sam9x60ek: Add NAND flash support
configs: Addsam9x60ek_nandflash_defconfig
configs: sam9x60ek: AddQSPI_BOOTdefines
ARM: dts: at91: sam9x60ek: Enable qspi node
configs: Addsam9x60ek_qspiflash_defconfigarch/arm/dts/Makefile | 2 + arch/arm/dts/sam9x60.dtsi | 285 +++++++++++++++++++++ arch/arm/dts/sam9x60ek-u-boot.dtsi | 132 ++++++++++ arch/arm/dts/sam9x60ek.dts | 55 ++++ arch/arm/mach-at91/Kconfig | 11 + arch/arm/mach-at91/arm926ejs/Makefile | 1 + arch/arm/mach-at91/arm926ejs/sam9x60_devices.c | 125 +++++++++ arch/arm/mach-at91/armv7/sama5d4_devices.c | 2 +- arch/arm/mach-at91/atmel_sfr.c | 2 +- .../include/mach/{sama5_sfr.h => at91_sfr.h} | 52 +++- arch/arm/mach-at91/include/mach/hardware.h | 2 + arch/arm/mach-at91/include/mach/sam9x60.h | 169 ++++++++++++ board/atmel/sam9x60ek/Kconfig | 12 + board/atmel/sam9x60ek/MAINTAINERS | 9 + board/atmel/sam9x60ek/Makefile | 7 + board/atmel/sam9x60ek/sam9x60ek.c | 120 +++++++++ board/laird/wb50n/wb50n.c | 2 +- configs/sam9x60ek_mmc_defconfig | 52 ++++ configs/sam9x60ek_nandflash_defconfig | 53 ++++ configs/sam9x60ek_qspiflash_defconfig | 75 ++++++ drivers/clk/at91/clk-utmi.c | 2 +- drivers/mmc/atmel_sdhci.c | 1 + drivers/net/macb.c | 1 + include/configs/sam9x60ek.h | 95 +++++++ 24 files changed, 1258 insertions(+), 9 deletions(-)create mode 100644
arch/arm/dts/sam9x60.dtsi
create mode 100644arch/arm/dts/sam9x60ek-u-boot.dtsi
create mode 100644arch/arm/dts/sam9x60ek.dts
create mode 100644arch/arm/mach-at91/arm926ejs/sam9x60_devices.crenamearch/arm/mach-at91/include/mach/{sama5_sfr.h=>at91_sfr.h} (53%) create mode 100644arch/arm/mach-at91/include/mach/sam9x60.hcreate mode 100644 board/atmel/sam9x60ek/Kconfig
create mode 100644 board/atmel/sam9x60ek/MAINTAINERS
create mode 100644 board/atmel/sam9x60ek/Makefile
create mode 100644board/atmel/sam9x60ek/sam9x60ek.c
create mode 100644 configs/sam9x60ek_mmc_defconfig
create mode 100644 configs/sam9x60ek_nandflash_defconfig create mode 100644 configs/sam9x60ek_qspiflash_defconfig create mode 100644include/configs/sam9x60ek.h