public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Durai Manickam KR <durai.manickamkr@microchip.com>
To: <u-boot@lists.denx.de>
Cc: <durai.manickamkr@microchip.com>
Subject: [PATCHv3 1/3] board: Add sam9x60_curiosity support
Date: Mon, 4 Apr 2022 11:23:18 +0530	[thread overview]
Message-ID: <20220404055320.26362-2-durai.manickamkr@microchip.com> (raw)
In-Reply-To: <20220404055320.26362-1-durai.manickamkr@microchip.com>

Add board files, Kconfig, Makefile and MAINTAINERS.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
---
 arch/arm/mach-at91/Kconfig                    |  7 ++
 board/atmel/sam9x60_curiosity/Kconfig         | 15 ++++
 board/atmel/sam9x60_curiosity/MAINTAINERS     |  6 ++
 board/atmel/sam9x60_curiosity/Makefile        |  7 ++
 .../sam9x60_curiosity/sam9x60_curiosity.c     | 75 +++++++++++++++++++
 include/configs/sam9x60_curiosity.h           | 31 ++++++++
 6 files changed, 141 insertions(+)
 create mode 100644 board/atmel/sam9x60_curiosity/Kconfig
 create mode 100644 board/atmel/sam9x60_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sam9x60_curiosity/Makefile
 create mode 100644 board/atmel/sam9x60_curiosity/sam9x60_curiosity.c
 create mode 100644 include/configs/sam9x60_curiosity.h

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 145c4b276b..7b2a62bf8a 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -164,6 +164,12 @@ config TARGET_SAM9X60EK
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 
+config TARGET_SAM9X60_CURIOSITY
+        bool "SAM9X60 CURIOSITY 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
@@ -335,6 +341,7 @@ source "board/atmel/at91sam9n12ek/Kconfig"
 source "board/atmel/at91sam9rlek/Kconfig"
 source "board/atmel/at91sam9x5ek/Kconfig"
 source "board/atmel/sam9x60ek/Kconfig"
+source "board/atmel/sam9x60_curiosity/Kconfig"
 source "board/atmel/sama7g5ek/Kconfig"
 source "board/atmel/sama5d2_ptc_ek/Kconfig"
 source "board/atmel/sama5d2_xplained/Kconfig"
diff --git a/board/atmel/sam9x60_curiosity/Kconfig b/board/atmel/sam9x60_curiosity/Kconfig
new file mode 100644
index 0000000000..ae84e0f32c
--- /dev/null
+++ b/board/atmel/sam9x60_curiosity/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_SAM9X60_CURIOSITY
+
+config SYS_BOARD
+	default "sam9x60_curiosity"
+
+config SYS_VENDOR
+	default "atmel"
+
+config SYS_SOC
+        default "at91"
+
+config SYS_CONFIG_NAME
+	default "sam9x60_curiosity"
+
+endif
diff --git a/board/atmel/sam9x60_curiosity/MAINTAINERS b/board/atmel/sam9x60_curiosity/MAINTAINERS
new file mode 100644
index 0000000000..84a3a9f186
--- /dev/null
+++ b/board/atmel/sam9x60_curiosity/MAINTAINERS
@@ -0,0 +1,6 @@
+SAM9X60 CURIOSITY BOARD
+M:	Durai Manickam KR <durai.manickamkr@microchip.com>
+M:	Eugen Hristev <eugen.hristev@microchip.com>
+S:	Maintained
+F:	board/atmel/sam9x60_curiosity/
+F:	include/configs/sam9x60_curiosity.h
diff --git a/board/atmel/sam9x60_curiosity/Makefile b/board/atmel/sam9x60_curiosity/Makefile
new file mode 100644
index 0000000000..c4d17e66d4
--- /dev/null
+++ b/board/atmel/sam9x60_curiosity/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
+#
+# Author: Durai Manickam KR <durai.manickamkr@microchip.com>
+
+obj-y += sam9x60_curiosity.o
diff --git a/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c
new file mode 100644
index 0000000000..00de277812
--- /dev/null
+++ b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Durai Manickam KR <durai.manickamkr@microchip.com>
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <fdtdec.h>
+#include <init.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_sfr.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/clk.h>
+#include <asm/arch/gpio.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/mach-types.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void at91_prepare_cpu_var(void);
+
+int board_late_init(void)
+{
+	at91_prepare_cpu_var();
+
+	return 0;
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+	at91_seriald_hw_init();
+}
+#endif
+
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#endif
+	return 0;
+}
+
+#define MAC24AA_MAC_OFFSET     0xfa
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_I2C_EEPROM
+	at91_set_ethaddr(MAC24AA_MAC_OFFSET);
+#endif
+	return 0;
+}
+#endif
+
+int board_init(void)
+{
+	/* address of boot parameters */
+	gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+	return 0;
+}
+
+int dram_init_banksize(void)
+{
+	return fdtdec_setup_memory_banksize();
+}
+
+int dram_init(void)
+{
+	return fdtdec_setup_mem_size_base();
+}
diff --git a/include/configs/sam9x60_curiosity.h b/include/configs/sam9x60_curiosity.h
new file mode 100644
index 0000000000..2708711a4e
--- /dev/null
+++ b/include/configs/sam9x60_curiosity.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration settings for the SAM9X60 CURIOSITY board.
+ *
+ * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Durai Manickam KR <durai.manickamkr@microchip.com>
+ */
+
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define CONFIG_SYS_AT91_SLOW_CLOCK	32768
+#define CONFIG_SYS_AT91_MAIN_CLOCK	24000000	/* 24 MHz crystal */
+
+#define CONFIG_USART_BASE   ATMEL_BASE_DBGU
+#define CONFIG_USART_ID     0 /* ignored in arm */
+
+/* SDRAM */
+#define CONFIG_SYS_SDRAM_BASE		0x20000000
+#define CONFIG_SYS_SDRAM_SIZE		0x8000000	/* 128 MB */
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_INIT_SP_ADDR         0x218000
+#else
+#define CONFIG_SYS_INIT_SP_ADDR \
+	(CONFIG_SYS_SDRAM_BASE + 16 * 1024 + CONFIG_SYS_MALLOC_F_LEN - \
+	 GENERATED_GBL_DATA_SIZE)
+#endif
+
+#endif
-- 
2.25.1


  reply	other threads:[~2022-04-04 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04  5:53 [PATCHv3 0/3] Add support for sam9x60_curiosity Durai Manickam KR
2022-04-04  5:53 ` Durai Manickam KR [this message]
2022-04-04  5:53 ` [PATCHv3 2/3] ARM: dts: Add device tree files " Durai Manickam KR
2022-04-04  5:53 ` [PATCHv3 3/3] configs: Add sam9x60_curiosity_mmc_defconfig Durai Manickam KR
2022-04-27  6:00 ` [PATCHv3 0/3] Add support for sam9x60_curiosity 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=20220404055320.26362-2-durai.manickamkr@microchip.com \
    --to=durai.manickamkr@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