From: Eugen Hristev <eugen.hristev@microchip.com>
To: u-boot@lists.denx.de
Subject: [PATCH 02/34] board: atmel: sama7g5ek: add initial support for sama7g5ek
Date: Thu, 3 Dec 2020 11:28:18 +0200 [thread overview]
Message-ID: <20201203092850.7909-3-eugen.hristev@microchip.com> (raw)
In-Reply-To: <20201203092850.7909-1-eugen.hristev@microchip.com>
Add initial support for sama7g5 evaluation kit board.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
arch/arm/dts/Makefile | 3 ++
arch/arm/dts/sama7g5ek-u-boot.dtsi | 33 +++++++++++++++
arch/arm/dts/sama7g5ek.dts | 39 +++++++++++++++++
arch/arm/mach-at91/Kconfig | 8 ++++
board/atmel/sama7g5ek/Kconfig | 15 +++++++
board/atmel/sama7g5ek/MAINTAINERS | 7 +++
board/atmel/sama7g5ek/Makefile | 7 +++
board/atmel/sama7g5ek/sama7g5ek.c | 68 ++++++++++++++++++++++++++++++
configs/sama7g5ek_mmc1_defconfig | 59 ++++++++++++++++++++++++++
include/configs/sama7g5ek.h | 46 ++++++++++++++++++++
10 files changed, 285 insertions(+)
create mode 100644 arch/arm/dts/sama7g5ek-u-boot.dtsi
create mode 100644 arch/arm/dts/sama7g5ek.dts
create mode 100644 board/atmel/sama7g5ek/Kconfig
create mode 100644 board/atmel/sama7g5ek/MAINTAINERS
create mode 100644 board/atmel/sama7g5ek/Makefile
create mode 100644 board/atmel/sama7g5ek/sama7g5ek.c
create mode 100644 configs/sama7g5ek_mmc1_defconfig
create mode 100644 include/configs/sama7g5ek.h
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5308713df7..fa5590561a 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -886,6 +886,9 @@ dtb-$(CONFIG_TARGET_OMAP4_SDP4430) += \
dtb-$(CONFIG_TARGET_OMAP5_UEVM) += \
omap5-uevm.dtb
+dtb-$(CONFIG_TARGET_SAMA7G5EK) += \
+ sama7g5ek.dtb
+
dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \
at91-sama5d2_ptc_ek.dtb
diff --git a/arch/arm/dts/sama7g5ek-u-boot.dtsi b/arch/arm/dts/sama7g5ek-u-boot.dtsi
new file mode 100644
index 0000000000..c0f8f94027
--- /dev/null
+++ b/arch/arm/dts/sama7g5ek-u-boot.dtsi
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * sama7g5ek-u-boot.dts - Device Tree file for SAMA7G5 SoC u-boot properties.
+ *
+ * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Eugen Hristev <eugen.hristev@microchip.com>
+ * Author: Claudiu Beznea <claudiu.beznea@microchip.com>
+ *
+ */
+
+/ {
+ chosen {
+ u-boot,dm-pre-reloc;
+ };
+
+ ahb {
+ u-boot,dm-pre-reloc;
+
+ apb {
+ u-boot,dm-pre-reloc;
+ };
+ };
+};
+
+&uart0 {
+ u-boot,dm-pre-reloc;
+};
+
+&mck {
+ u-boot,dm-pre-reloc;
+};
+
diff --git a/arch/arm/dts/sama7g5ek.dts b/arch/arm/dts/sama7g5ek.dts
new file mode 100644
index 0000000000..41a754df6f
--- /dev/null
+++ b/arch/arm/dts/sama7g5ek.dts
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * sama7g5ek.dts - Device Tree file for SAMA7G5 EK
+ * SAMA7G5 Evaluation Kit
+ *
+ * Copyright (c) 2020, Microchip Technology Inc.
+ * 2020, Eugen Hristev <eugen.hristev@microchip.com>
+ * 2020, Claudiu Beznea <claudiu.beznea@microchip.com>
+ */
+/dts-v1/;
+#include "sama7g5.dtsi"
+#include "sama7g5-pinfunc.h"
+
+/ {
+ model = "Microchip SAMA7G5 Evaluation Kit";
+ compatible = "microchip,sama7g5ek", "microchip,sama7g54", "microchip,sama7g5", "microchip,sama7";
+
+ aliases {
+ serial0 = &uart0;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ ahb {
+
+ apb {
+ sdmmc1: sdio-host at e1208000 {
+ bus-width = <4>;
+ status = "okay";
+ };
+
+ uart0: serial at e1824200 {
+ status = "okay";
+ };
+ };
+ };
+};
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index be1415f909..c78a308f48 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -265,6 +265,13 @@ config TARGET_CORVUS
select SUPPORT_SPL
imply CMD_DM
+config TARGET_SAMA7G5EK
+ bool "SAMA7G5 EK board"
+ select SAMA7G5
+ select BOARD_EARLY_INIT_F
+ select BOARD_LATE_INIT
+
+
config TARGET_TAURUS
bool "Support taurus"
select AT91SAM9G20
@@ -327,6 +334,7 @@ source "board/atmel/at91sam9n12ek/Kconfig"
source "board/atmel/at91sam9rlek/Kconfig"
source "board/atmel/at91sam9x5ek/Kconfig"
source "board/atmel/sam9x60ek/Kconfig"
+source "board/atmel/sama7g5ek/Kconfig"
source "board/atmel/sama5d2_ptc_ek/Kconfig"
source "board/atmel/sama5d2_xplained/Kconfig"
source "board/atmel/sama5d27_som1_ek/Kconfig"
diff --git a/board/atmel/sama7g5ek/Kconfig b/board/atmel/sama7g5ek/Kconfig
new file mode 100644
index 0000000000..a89db8d8a8
--- /dev/null
+++ b/board/atmel/sama7g5ek/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_SAMA7G5EK
+
+config SYS_BOARD
+ default "sama7g5ek"
+
+config SYS_VENDOR
+ default "atmel"
+
+config SYS_SOC
+ default "at91"
+
+config SYS_CONFIG_NAME
+ default "sama7g5ek"
+
+endif
diff --git a/board/atmel/sama7g5ek/MAINTAINERS b/board/atmel/sama7g5ek/MAINTAINERS
new file mode 100644
index 0000000000..f66953ac4e
--- /dev/null
+++ b/board/atmel/sama7g5ek/MAINTAINERS
@@ -0,0 +1,7 @@
+SAMA7G5 EK BOARD
+M: Eugen Hristev <eugen.hristev@microchip.com>
+S: Maintained
+F: board/atmel/sama7g5ek.c
+F: include/configs/sama7g5ek.h
+F: configs/sama7g5ek_mmc1_defconfig
+
diff --git a/board/atmel/sama7g5ek/Makefile b/board/atmel/sama7g5ek/Makefile
new file mode 100644
index 0000000000..a6eedd10fa
--- /dev/null
+++ b/board/atmel/sama7g5ek/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Microchip Technology Inc.
+# Eugen Hristev <eugen.hristev@microchip.com>
+#
+
+obj-y += sama7g5ek.o
diff --git a/board/atmel/sama7g5ek/sama7g5ek.c b/board/atmel/sama7g5ek/sama7g5ek.c
new file mode 100644
index 0000000000..1d7a01593d
--- /dev/null
+++ b/board/atmel/sama7g5ek/sama7g5ek.c
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2020 Microchip Technology, Inc.
+ * Eugen Hristev <eugen.hristev@microchip.com>
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <init.h>
+#include <asm/io.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/atmel_pio4.h>
+#include <asm/arch/clk.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/sama7g5.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_late_init(void)
+{
+ return 0;
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+static void board_uart0_hw_init(void)
+{
+ /* FLEXCOM3 IO0 */
+ atmel_pio4_set_f_periph(AT91_PIO_PORTD, 17, ATMEL_PIO_PUEN_MASK);
+ /* FLEXCOM3 IO1 */
+ atmel_pio4_set_f_periph(AT91_PIO_PORTD, 16, 0);
+
+ at91_periph_clk_enable(ATMEL_ID_FLEXCOM3);
+}
+
+void board_debug_uart_init(void)
+{
+ board_uart0_hw_init();
+}
+#endif
+
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+ debug_uart_init();
+#endif
+ return 0;
+}
+
+int board_init(void)
+{
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+ CONFIG_SYS_SDRAM_SIZE);
+ return 0;
+}
+
+int misc_init_r(void)
+{
+ return 0;
+}
+
diff --git a/configs/sama7g5ek_mmc1_defconfig b/configs/sama7g5ek_mmc1_defconfig
new file mode 100644
index 0000000000..d54af0ccbf
--- /dev/null
+++ b/configs/sama7g5ek_mmc1_defconfig
@@ -0,0 +1,59 @@
+CONFIG_ARM=y
+CONFIG_ARCH_AT91=y
+CONFIG_SYS_TEXT_BASE=0x66f00000
+CONFIG_TARGET_SAMA7G5EK=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x4000
+CONFIG_DM_GPIO=y
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_BASE=0xe1824200
+CONFIG_DEBUG_UART_CLOCK=200000000
+CONFIG_DEFAULT_DEVICE_TREE="sama7g5ek"
+CONFIG_DEBUG_UART=y
+CONFIG_ENV_VARS_UBOOT_CONFIG=y
+CONFIG_FIT=y
+CONFIG_SD_BOOT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_MISC_INIT_R=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_AUTOBOOT is not set
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_MD5SUM=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x60000000
+CONFIG_SYS_MEMTEST_END=0x70000000
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
+CONFIG_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_AT91_GENERIC_CLK=y
+CONFIG_ATMEL_PIO4=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ATMEL=y
+CONFIG_DM_ETH=y
+CONFIG_MACB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91PIO4=y
+# CONFIG_RAM_ROCKCHIP_DEBUG is not set
+CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_ATMEL_USART=y
+CONFIG_TIMER=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+# CONFIG_EFI_LOADER_HII is not set
diff --git a/include/configs/sama7g5ek.h b/include/configs/sama7g5ek.h
new file mode 100644
index 0000000000..3b3432ba5e
--- /dev/null
+++ b/include/configs/sama7g5ek.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration file for the SAMA7G5EK Board.
+ *
+ * Copyright (C) 2020 Microchip Corporation
+ * Eugen Hristev <eugen.hristev@microchip.com>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_SYS_AT91_SLOW_CLOCK 32768
+#define CONFIG_SYS_AT91_MAIN_CLOCK 24000000 /* from 24 MHz crystal */
+
+/* SDRAM */
+#define CONFIG_SYS_SDRAM_BASE 0x60000000
+#define CONFIG_SYS_SDRAM_SIZE 0x20000000
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_INIT_SP_ADDR 0x218000
+#else
+#define CONFIG_SYS_INIT_SP_ADDR \
+ (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
+#endif
+
+#define CONFIG_SYS_LOAD_ADDR 0x62000000 /* load address */
+
+#undef CONFIG_BOOTCOMMAND
+#ifdef CONFIG_SD_BOOT
+/* u-boot env in sd/mmc card */
+#define FAT_ENV_INTERFACE "mmc"
+#define FAT_ENV_DEVICE_AND_PART "0"
+#define FAT_ENV_FILE "uboot.env"
+/* bootstrap + u-boot + env in sd card */
+#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x61000000 at91-sama7g5ek.dtb; " \
+ "fatload mmc 0:1 0x62000000 zImage; " \
+ "bootz 0x62000000 - 0x61000000"
+#undef CONFIG_BOOTARGS
+#define CONFIG_BOOTARGS \
+ "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"
+#endif
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
+
+#endif
--
2.25.1
next prev parent reply other threads:[~2020-12-03 9:28 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 9:28 [PATCH 00/34] Sama7g5 Evaluation Kit support Eugen Hristev
2020-12-03 9:28 ` [PATCH 01/34] ARM: dts: sama7g5: add initial DT for sama7g5 SoC Eugen Hristev
2020-12-03 9:28 ` Eugen Hristev [this message]
2020-12-03 9:28 ` [PATCH 03/34] board: atmel: sama7g5ek: add SYS_MALLOC_F_LEN to SYS_INIT_SP_ADDR Eugen Hristev
2020-12-03 9:28 ` [PATCH 04/34] configs: sama7g5ek: set malloc pool to 68K Eugen Hristev
2020-12-03 9:28 ` [PATCH 05/34] configs: sama7g5ek: enable pll driver Eugen Hristev
2020-12-03 9:28 ` [PATCH 06/34] ARM: dts: sama7g5: move clock frequencies for xtals in board file Eugen Hristev
2020-12-03 9:28 ` [PATCH 07/34] ARM: dts: sama7g5: add slow rc and main rc oscillators Eugen Hristev
2020-12-03 9:28 ` [PATCH 08/34] ARM: dts: sama7g5: add u-boot, dm-pre-reloc bindings for xtals Eugen Hristev
2020-12-03 9:28 ` [PATCH 09/34] ARM: dts: sama7g5: add slow clock bindings Eugen Hristev
2020-12-03 9:28 ` [PATCH 10/34] ARM: dts: sama7g5: add PMC bindings Eugen Hristev
2020-12-03 9:28 ` [PATCH 11/34] ARM: dts: sama7g5: switch to " Eugen Hristev
2020-12-03 9:28 ` [PATCH 12/34] configs: sama7g5: enable CONFIG_CPU Eugen Hristev
2020-12-03 9:28 ` [PATCH 13/34] ARM: dts: sama7g5: add CPU bindings Eugen Hristev
2020-12-03 9:28 ` [PATCH 14/34] configs: sama7g5: use PIT64B Eugen Hristev
2020-12-03 9:28 ` [PATCH 15/34] ARM: dts: sama7g5: enable autoboot Eugen Hristev
2020-12-03 9:28 ` [PATCH 16/34] ARM: dts: sama7g5: add pit64b support Eugen Hristev
2020-12-03 9:28 ` [PATCH 17/34] ARM: dts: at91: sama7g5: add pinctrl node Eugen Hristev
2020-12-03 9:28 ` [PATCH 18/34] ARM: dts: at91: sama7g5ek: add pinctrl for sdmmc1 and flx3 Eugen Hristev
2020-12-03 9:28 ` [PATCH 19/34] configs: sama7g5ek: enable mii command Eugen Hristev
2020-12-03 9:28 ` [PATCH 20/34] ARM: dts: sama7g5: add GMAC0 Eugen Hristev
2020-12-03 9:28 ` [PATCH 21/34] ARM: dts: sama7g5: add GMAC1 Eugen Hristev
2020-12-03 9:28 ` [PATCH 22/34] board: atmel: sama7g5ek: increase arp timeout and retry count Eugen Hristev
2020-12-03 9:28 ` [PATCH 23/34] configs: sama7g5ek: enable support for KSZ9131 Eugen Hristev
2020-12-03 9:28 ` [PATCH 24/34] configs: sama7g5ek: enable CCF Eugen Hristev
2020-12-03 9:28 ` [PATCH 25/34] ARM: dts: at91: sama7g5: add assigned clocks for sdmmc1 Eugen Hristev
2020-12-03 9:28 ` [PATCH 26/34] ARM: dts: at91: sama7g5: add node for sdmmc0 Eugen Hristev
2020-12-03 9:28 ` [PATCH 27/34] ARM: dts: at91: sama7g5ek: enable sdmmc0 with pinctrl Eugen Hristev
2020-12-03 9:28 ` [PATCH 28/34] board: atmel: sama7g5ek: clean-up header bootcommand Eugen Hristev
2020-12-03 9:28 ` [PATCH 29/34] configs: sama7g5: add mmc config for sdmmc0 Eugen Hristev
2020-12-03 10:38 ` Jaehoon Chung
2020-12-03 10:47 ` Eugen.Hristev at microchip.com
2020-12-03 11:11 ` Jaehoon Chung
2020-12-03 11:20 ` Eugen.Hristev at microchip.com
2020-12-03 21:45 ` Jaehoon Chung
2020-12-04 7:00 ` Eugen.Hristev at microchip.com
2020-12-06 22:15 ` Jaehoon Chung
2020-12-03 9:28 ` [PATCH 30/34] ARM: dts: at91: sama7g5: add flexcom1 and i2c subnode Eugen Hristev
2020-12-03 9:28 ` [PATCH 31/34] ARM: dts: sama7g5ek: add i2c1 bus and eeproms Eugen Hristev
2020-12-03 9:28 ` [PATCH 32/34] board: atmel: sama7g5ek: add support for MAC address retreival Eugen Hristev
2020-12-03 9:28 ` [PATCH 33/34] configs: sama7g5ek: add i2c and eeprom Eugen Hristev
2020-12-03 9:28 ` [PATCH 34/34] ARM: dts: sama7g5ek: fix TXC pin configuration Eugen Hristev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201203092850.7909-3-eugen.hristev@microchip.com \
--to=eugen.hristev@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox