mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
Merge tag 'u-boot-at91-2025.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next
First set of u-boot-at91 features for the 2025.10 cycle: This feature set includes the addition of new sam9x7 SoC and a new board named sam9x7-curiosity. There is also new support for sam9x60 compatible at91 watchdog.
This commit is contained in:
@@ -468,7 +468,6 @@ F: drivers/memory/atmel-ebi.c
|
||||
F: drivers/misc/microchip_flexcom.c
|
||||
F: drivers/timer/atmel_tcb_timer.c
|
||||
F: include/dt-bindings/clk/at91.h
|
||||
F: include/dt-bindings/clock/at91.h
|
||||
F: include/dt-bindings/dma/at91.h
|
||||
F: include/dt-bindings/mfd/at91-usart.h
|
||||
F: include/dt-bindings/mfd/atmel-flexcom.h
|
||||
|
||||
@@ -95,3 +95,7 @@
|
||||
&slow_xtal {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
timeout-sec = <16>;
|
||||
};
|
||||
|
||||
@@ -336,3 +336,7 @@
|
||||
&usb2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
95
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
Normal file
95
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
Normal file
@@ -0,0 +1,95 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
/*
|
||||
* at91-sam9x75_curiosity-u-boot.dtsi - Device Tree file for SAM9X75
|
||||
* CURIOSITY board.
|
||||
*
|
||||
* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
*
|
||||
* Author: Manikandan Muralidharan <manikandan.m@microchip.com>
|
||||
*/
|
||||
|
||||
/ {
|
||||
cpus {
|
||||
cpu@0 {
|
||||
clocks = <&pmc PMC_TYPE_CORE 25>, <&pmc PMC_TYPE_CORE 17>, <&main_xtal>;
|
||||
clock-names = "cpu", "master", "xtal";
|
||||
};
|
||||
};
|
||||
|
||||
clocks {
|
||||
slow_rc_osc: slow_rc_osc {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <18500>;
|
||||
};
|
||||
};
|
||||
|
||||
ahb {
|
||||
bootph-all;
|
||||
|
||||
apb {
|
||||
bootph-all;
|
||||
|
||||
pinctrl {
|
||||
bootph-all;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootph-all;
|
||||
};
|
||||
};
|
||||
|
||||
&clk32k {
|
||||
bootph-all;
|
||||
clocks = <&slow_rc_osc>, <&slow_xtal>;
|
||||
};
|
||||
|
||||
&dbgu {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&gmac {
|
||||
compatible = "microchip,sam9x7-gem", "cdns,sama7g5-gem";
|
||||
};
|
||||
|
||||
&main_xtal {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pinctrl_dbgu_default {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pinctrl_sdmmc0_default {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pioA {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pioB {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pit64b0 {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&pmc {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&sdmmc0 {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&slow_xtal {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&slow_rc_osc {
|
||||
bootph-all;
|
||||
};
|
||||
@@ -311,6 +311,14 @@
|
||||
clocks = <&slow_rc_osc>, <&slow_xtal>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
watchdog: watchdog@ffffff80 {
|
||||
compatible = "microchip,sam9x60-wdt";
|
||||
reg = <0xffffff80 0x24>;
|
||||
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
|
||||
clocks = <&clk32 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,10 @@ config SAM9X60
|
||||
bool
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config SAM9X7
|
||||
bool
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config SAMA7G5
|
||||
bool
|
||||
select CPU_V7A
|
||||
@@ -154,6 +158,13 @@ config TARGET_SAM9X60_CURIOSITY
|
||||
select BOARD_EARLY_INIT_F
|
||||
select BOARD_LATE_INIT
|
||||
|
||||
config TARGET_SAM9X75_CURIOSITY
|
||||
bool "SAM9X75 CURIOSITY board"
|
||||
select SAM9X7
|
||||
select BOARD_EARLY_INIT_F
|
||||
select BOARD_LATE_INIT
|
||||
imply OF_UPSTREAM
|
||||
|
||||
config TARGET_SAMA5D2_PTC_EK
|
||||
bool "SAMA5D2 PTC EK board"
|
||||
select BOARD_EARLY_INIT_F
|
||||
@@ -351,6 +362,7 @@ source "board/atmel/at91sam9rlek/Kconfig"
|
||||
source "board/atmel/at91sam9x5ek/Kconfig"
|
||||
source "board/atmel/sam9x60ek/Kconfig"
|
||||
source "board/atmel/sam9x60_curiosity/Kconfig"
|
||||
source "board/atmel/sam9x75_curiosity/Kconfig"
|
||||
source "board/atmel/sama7g5ek/Kconfig"
|
||||
source "board/atmel/sama7g54_curiosity/Kconfig"
|
||||
source "board/atmel/sama5d2_ptc_ek/Kconfig"
|
||||
|
||||
@@ -14,6 +14,7 @@ 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_SAM9X7) += sam9x7_devices.o
|
||||
obj-y += clock.o
|
||||
obj-y += cpu.o
|
||||
ifndef CONFIG_$(PHASE_)SYSRESET
|
||||
|
||||
49
arch/arm/mach-at91/arm926ejs/sam9x7_devices.c
Normal file
49
arch/arm/mach-at91/arm926ejs/sam9x7_devices.c
Normal file
@@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
*/
|
||||
|
||||
#include <asm/arch/at91_common.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
unsigned int get_chip_id(void)
|
||||
{
|
||||
/* The 0x40 is the offset of cidr in DBGU */
|
||||
return readl(ATMEL_BASE_DBGU + 0x40);
|
||||
}
|
||||
|
||||
unsigned int get_extension_chip_id(void)
|
||||
{
|
||||
/* The 0x44 is the offset of exid in DBGU */
|
||||
return readl(ATMEL_BASE_DBGU + 0x44);
|
||||
}
|
||||
|
||||
char *get_cpu_name(void)
|
||||
{
|
||||
unsigned int extension_id = get_extension_chip_id();
|
||||
|
||||
if (cpu_is_sam9x7()) {
|
||||
switch (extension_id) {
|
||||
case ARCH_EXID_SAM9X70:
|
||||
return "SAM9X70";
|
||||
case ARCH_EXID_SAM9X72:
|
||||
return "SAM9X72";
|
||||
case ARCH_EXID_SAM9X75:
|
||||
return "SAM9X75";
|
||||
case ARCH_EXID_SAM9X75_D1M:
|
||||
return "SAM9X75 16MB DDR2 SiP";
|
||||
case ARCH_EXID_SAM9X75_D5M:
|
||||
return "SAM9X75 64MB DDR2 SiP";
|
||||
case ARCH_EXID_SAM9X75_D1G:
|
||||
return "SAM9X75 125MB DDR3L SiP";
|
||||
case ARCH_EXID_SAM9X75_D2G:
|
||||
return "SAM9X75 250MB DDR3L SiP";
|
||||
default:
|
||||
return "Unknown CPU type";
|
||||
}
|
||||
} else {
|
||||
return "Unknown CPU type";
|
||||
}
|
||||
}
|
||||
@@ -19,15 +19,16 @@
|
||||
|
||||
#else
|
||||
|
||||
typedef struct at91_wdt {
|
||||
u32 cr;
|
||||
u32 mr;
|
||||
u32 sr;
|
||||
} at91_wdt_t;
|
||||
enum {
|
||||
AT91_WDT_MODE_SAM9260 = 0,
|
||||
AT91_WDT_MODE_SAM9X60 = 1
|
||||
};
|
||||
|
||||
struct at91_wdt_priv {
|
||||
void __iomem *regs;
|
||||
u32 regval;
|
||||
u32 mr;
|
||||
u32 wddis;
|
||||
u8 mode;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -39,14 +40,22 @@ struct at91_wdt_priv {
|
||||
|
||||
/* Watchdog Mode Register*/
|
||||
#define AT91_WDT_MR 0x04
|
||||
#define AT91_WDT_MR_WDV(x) (x & 0xfff)
|
||||
#define AT91_WDT_MR_WDV(x) ((x) & 0xfff)
|
||||
#define AT91_SAM9X60_MR_PERIODRST 0x00000010
|
||||
#define AT91_WDT_MR_WDFIEN 0x00001000
|
||||
#define AT91_SAM9X60_MR_WDDIS 0x00001000
|
||||
#define AT91_WDT_MR_WDRSTEN 0x00002000
|
||||
#define AT91_WDT_MR_WDRPROC 0x00004000
|
||||
#define AT91_WDT_MR_WDDIS 0x00008000
|
||||
#define AT91_WDT_MR_WDD(x) ((x & 0xfff) << 16)
|
||||
#define AT91_WDT_MR_WDD(x) (((x) & 0xfff) << 16)
|
||||
#define AT91_WDT_MR_WDDBGHLT 0x10000000
|
||||
#define AT91_SAM9X60_MR_WDIDLEHLT 0x10000000
|
||||
#define AT91_WDT_MR_WDIDLEHLT 0x20000000
|
||||
#define AT91_SAM9X60_MR_WDDBGHLT 0x20000000
|
||||
|
||||
/* Watchdog Window Level Register */
|
||||
#define AT91_SAM9X60_WLR 0x0c
|
||||
#define AT91_SAM9X60_WLR_COUNTER(x) ((x) & 0xfff)
|
||||
|
||||
/* Hardware timeout in seconds */
|
||||
#define WDT_MAX_TIMEOUT 16
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# include <asm/arch/at91sam9x5.h>
|
||||
#elif defined(CONFIG_SAM9X60)
|
||||
# include <asm/arch/sam9x60.h>
|
||||
#elif defined(CONFIG_SAM9X7)
|
||||
# include <asm/arch/sam9x7.h>
|
||||
#elif defined(CONFIG_SAMA7G5)
|
||||
# include <asm/arch/sama7g5.h>
|
||||
#elif defined(CONFIG_SAMA5D2)
|
||||
|
||||
172
arch/arm/mach-at91/include/mach/sam9x7.h
Normal file
172
arch/arm/mach-at91/include/mach/sam9x7.h
Normal file
@@ -0,0 +1,172 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Chip-specific header file for the SAM9X7 SoC.
|
||||
*
|
||||
* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
*/
|
||||
|
||||
#ifndef __SAM9X7_H__
|
||||
#define __SAM9X7_H__
|
||||
|
||||
/*
|
||||
* Peripheral identifiers/interrupts.
|
||||
*/
|
||||
#define ATMEL_ID_FIQ 0 /* Advanced Interrupt Controller - FIQ */
|
||||
#define ATMEL_ID_SYS 1 /* System Controller Interrupt */
|
||||
#define ATMEL_ID_PIOA 2 /* Parallel I/O Controller A */
|
||||
#define ATMEL_ID_PIOB 3 /* Parallel I/O Controller B */
|
||||
#define ATMEL_ID_PIOC 4 /* Parallel I/O Controller C */
|
||||
#define ATMEL_ID_FLEXCOM0 5 /* FLEXCOM 0 */
|
||||
#define ATMEL_ID_FLEXCOM1 6 /* FLEXCOM 1 */
|
||||
#define ATMEL_ID_FLEXCOM2 7 /* FLEXCOM 2 */
|
||||
#define ATMEL_ID_FLEXCOM3 8 /* FLEXCOM 3 */
|
||||
#define ATMEL_ID_FLEXCOM6 9 /* FLEXCOM 6 */
|
||||
#define ATMEL_ID_FLEXCOM7 10 /* FLEXCOM 7 */
|
||||
#define ATMEL_ID_FLEXCOM8 11 /* FLEXCOM 8 */
|
||||
#define ATMEL_ID_SDMMC0 12 /* SDMMC 0 */
|
||||
#define ATMEL_ID_FLEXCOM4 13 /* FLEXCOM 4 */
|
||||
#define ATMEL_ID_FLEXCOM5 14 /* FLEXCOM 5 */
|
||||
#define ATMEL_ID_FLEXCOM9 15 /* FLEXCOM 9 */
|
||||
#define ATMEL_ID_FLEXCOM10 16 /* FLEXCOM 10 */
|
||||
#define ATMEL_ID_TC01 17 /* Timer Counter 0, 1, 2, 3, 4 and 5 */
|
||||
#define ATMEL_ID_PWM 18 /* Pulse Width Modulation Controller */
|
||||
#define ATMEL_ID_ADC 19 /* ADC Controller */
|
||||
#define ATMEL_ID_XDMAC0 20 /* XDMA Controller 0 */
|
||||
#define ATMEL_ID_MATRIX 21 /* BUS Matrix */
|
||||
#define ATMEL_ID_UHPHS 22 /* USB Host High Speed */
|
||||
#define ATMEL_ID_UDPHS 23 /* USB Device High Speed */
|
||||
#define ATMEL_ID_GMAC 24 /* GMAC */
|
||||
#define ATMEL_ID_LCDC 25 /* LCD Controller */
|
||||
#define ATMEL_ID_SDMMC1 26 /* SDMMC 1 */
|
||||
#define ATMEL_ID_SSC 28 /* Synchronous Serial Controller */
|
||||
#define ATMEL_ID_IRQ 31 /* Advanced Interrupt Controller - IRQ */
|
||||
#define ATMEL_ID_TRNG 38 /* True Random Number Generator */
|
||||
#define ATMEL_ID_PIOD 44 /* Parallel I/O Controller D */
|
||||
#define ATMEL_ID_DBGU 47 /* Debug unit */
|
||||
|
||||
/*
|
||||
* User Peripheral physical base addresses.
|
||||
*/
|
||||
#define ATMEL_BASE_FLEXCOM4 0xf0000000
|
||||
#define ATMEL_BASE_FLEXCOM5 0xf0004000
|
||||
#define ATMEL_BASE_XDMA0 0xf0008000
|
||||
#define ATMEL_BASE_SSC 0xf0010000
|
||||
#define ATMEL_BASE_QSPI 0xf0014000
|
||||
#define ATMEL_BASE_CAN0 0xf8000000
|
||||
#define ATMEL_BASE_CAN1 0xf8004000
|
||||
#define ATMEL_BASE_TC0 0xf8008000
|
||||
#define ATMEL_BASE_TC1 0xf800c000
|
||||
#define ATMEL_BASE_FLEXCOM6 0xf8010000
|
||||
#define ATMEL_BASE_FLEXCOM7 0xf8014000
|
||||
#define ATMEL_BASE_FLEXCOM8 0xf8018000
|
||||
#define ATMEL_BASE_FLEXCOM0 0xf801c000
|
||||
#define ATMEL_BASE_FLEXCOM1 0xf8020000
|
||||
#define ATMEL_BASE_FLEXCOM2 0xf8024000
|
||||
#define ATMEL_BASE_FLEXCOM3 0xf8028000
|
||||
#define ATMEL_BASE_GMAC 0xf802c000
|
||||
#define ATMEL_BASE_PWM 0xf8034000
|
||||
#define ATMEL_BASE_LCDC 0xf8038000
|
||||
#define ATMEL_BASE_UDPHS 0xf803c000
|
||||
#define ATMEL_BASE_FLEXCOM9 0xf8040000
|
||||
#define ATMEL_BASE_FLEXCOM10 0xf8044000
|
||||
#define ATMEL_BASE_ISC 0xf8048000
|
||||
#define ATMEL_BASE_ADC 0xf804c000
|
||||
#define ATMEL_BASE_SFR 0xf8050000
|
||||
#define ATMEL_BASE_SYS 0xffffc000
|
||||
|
||||
/*
|
||||
* System Peripherals
|
||||
*/
|
||||
#define ATMEL_BASE_MATRIX 0xffffde00
|
||||
#define ATMEL_BASE_PMECC 0xffffe000
|
||||
#define ATMEL_BASE_PMERRLOC 0xffffe600
|
||||
#define ATMEL_BASE_MPDDRC 0xffffe800
|
||||
#define ATMEL_BASE_SMC 0xffffea00
|
||||
#define ATMEL_BASE_SDRAMC 0xffffec00
|
||||
#define ATMEL_BASE_AIC 0xfffff100
|
||||
#define ATMEL_BASE_DBGU 0xfffff200
|
||||
#define ATMEL_BASE_PIOA 0xfffff400
|
||||
#define ATMEL_BASE_PIOB 0xfffff600
|
||||
#define ATMEL_BASE_PIOC 0xfffff800
|
||||
#define ATMEL_BASE_PIOD 0xfffffa00
|
||||
#define ATMEL_BASE_PMC 0xfffffc00
|
||||
#define ATMEL_BASE_RSTC 0xfffffe00
|
||||
#define ATMEL_BASE_SHDWC 0xfffffe10
|
||||
#define ATMEL_BASE_PIT 0xfffffe40
|
||||
#define ATMEL_BASE_GPBR 0xfffffe60
|
||||
#define ATMEL_BASE_RTC 0xfffffea8
|
||||
#define ATMEL_BASE_WDT 0xffffff80
|
||||
|
||||
/*
|
||||
* Internal Memory.
|
||||
*/
|
||||
#define ATMEL_BASE_ROM 0x00100000 /* Internal ROM base address */
|
||||
#define ATMEL_BASE_SRAM 0x00300000 /* Internal SRAM base address */
|
||||
#define ATMEL_BASE_UDPHS_FIFO 0x00500000 /* USB Device HS controller */
|
||||
#define ATMEL_BASE_OHCI 0x00600000 /* USB Host controller (OHCI) */
|
||||
#define ATMEL_BASE_EHCI 0x00700000 /* USB Host controller (EHCI) */
|
||||
|
||||
/*
|
||||
* External memory
|
||||
*/
|
||||
#define ATMEL_BASE_CS0 0x10000000
|
||||
#define ATMEL_BASE_CS1 0x20000000
|
||||
#define ATMEL_BASE_CS2 0x30000000
|
||||
#define ATMEL_BASE_CS3 0x40000000
|
||||
#define ATMEL_BASE_CS4 0x50000000
|
||||
#define ATMEL_BASE_CS5 0x60000000
|
||||
#define ATMEL_BASE_SDMMC0 0x80000000
|
||||
#define ATMEL_BASE_SDMMC1 0x90000000
|
||||
|
||||
/*
|
||||
* SAM9x7 series chip id definitions
|
||||
*/
|
||||
#define ARCH_ID_SAM9X7 0x89750030
|
||||
#define ARCH_EXID_SAM9X70 0x00000005
|
||||
#define ARCH_EXID_SAM9X72 0x00000004
|
||||
#define ARCH_EXID_SAM9X75 0x00000000
|
||||
#define ARCH_EXID_SAM9X75_D1G 0x00000018
|
||||
#define ARCH_EXID_SAM9X75_D2G 0x00000020
|
||||
#define ARCH_EXID_SAM9X75_D1M 0x00000003
|
||||
#define ARCH_EXID_SAM9X75_D5M 0x00000010
|
||||
|
||||
#define cpu_is_sam9x7() (get_chip_id() == ARCH_ID_SAM9X7)
|
||||
|
||||
/*
|
||||
* Cpu Name
|
||||
*/
|
||||
#define ATMEL_CPU_NAME get_cpu_name()
|
||||
|
||||
/*
|
||||
* Timer
|
||||
*/
|
||||
#define CFG_SYS_TIMER_COUNTER 0xf0028000
|
||||
|
||||
/*
|
||||
* Other misc defines
|
||||
*/
|
||||
#define ATMEL_PIO_PORTS 4
|
||||
#define CPU_HAS_PCR
|
||||
#define CPU_NO_PLLB
|
||||
#define PLL_ID_PLLA 0
|
||||
#define PLL_ID_UPLL 1
|
||||
#define PLL_ID_AUDIOPLL 2
|
||||
#define PLL_ID_LVDSPLL 3
|
||||
#define PLL_ID_PLLA_DIV_2 4
|
||||
|
||||
/*
|
||||
* PMECC table in ROM
|
||||
*/
|
||||
#define ATMEL_PMECC_INDEX_OFFSET_512 0x0000
|
||||
#define ATMEL_PMECC_INDEX_OFFSET_1024 0x8000
|
||||
|
||||
/*
|
||||
* SAM9X7 specific prototypes
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
unsigned int get_chip_id(void);
|
||||
unsigned int get_extension_chip_id(void);
|
||||
char *get_cpu_name(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -14,9 +14,7 @@
|
||||
#if !defined(CONFIG_WDT_AT91)
|
||||
void at91_disable_wdt(void)
|
||||
{
|
||||
struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
|
||||
|
||||
writel(AT91_WDT_MR_WDDIS, &wdt->mr);
|
||||
writel(AT91_WDT_MR_WDDIS, ATMEL_BASE_WDT + AT91_WDT_MR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
15
board/atmel/sam9x75_curiosity/Kconfig
Normal file
15
board/atmel/sam9x75_curiosity/Kconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
if TARGET_SAM9X75_CURIOSITY
|
||||
|
||||
config SYS_BOARD
|
||||
default "sam9x75_curiosity"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "atmel"
|
||||
|
||||
config SYS_SOC
|
||||
default "at91"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "sam9x75_curiosity"
|
||||
|
||||
endif
|
||||
7
board/atmel/sam9x75_curiosity/MAINTAINERS
Normal file
7
board/atmel/sam9x75_curiosity/MAINTAINERS
Normal file
@@ -0,0 +1,7 @@
|
||||
SAM9X75 CURIOSITY BOARD
|
||||
M: Manikandan Muralidharan <manikandan.m@microchip.com>
|
||||
S: Maintained
|
||||
F: board/atmel/sam9x75_curiosity/
|
||||
F: include/configs/sam9x75_curiosity.h
|
||||
F: arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
|
||||
F: configs/sam9x75_curiosity_mmc_defconfig
|
||||
7
board/atmel/sam9x75_curiosity/Makefile
Normal file
7
board/atmel/sam9x75_curiosity/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
#
|
||||
# Author: Manikandan Muralidharan <manikandan.m@microchip.com>
|
||||
|
||||
obj-y += sam9x75_curiosity.o
|
||||
66
board/atmel/sam9x75_curiosity/sam9x75_curiosity.c
Normal file
66
board/atmel/sam9x75_curiosity/sam9x75_curiosity.c
Normal file
@@ -0,0 +1,66 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
*
|
||||
* Author: Manikandan Muralidharan <manikandan.m@microchip.com>
|
||||
*/
|
||||
|
||||
#include <debug_uart.h>
|
||||
#include <init.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 <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;
|
||||
}
|
||||
|
||||
#if (IS_ENABLED(CONFIG_DEBUG_UART_BOARD_INIT))
|
||||
static void board_dbgu0_hw_init(void)
|
||||
{
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 26, 1); /* DRXD */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 27, 1); /* DTXD */
|
||||
|
||||
at91_periph_clk_enable(ATMEL_ID_DBGU);
|
||||
}
|
||||
|
||||
void board_debug_uart_init(void)
|
||||
{
|
||||
board_dbgu0_hw_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -65,7 +65,7 @@ int board_early_init_f(void)
|
||||
int board_init(void)
|
||||
{
|
||||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
|
||||
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
|
||||
|
||||
rgb_leds_init();
|
||||
|
||||
@@ -82,11 +82,14 @@ int misc_init_r(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
int dram_init_banksize(void)
|
||||
{
|
||||
return fdtdec_setup_memory_banksize();
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
gd->ram_size = get_ram_size((void *)CFG_SYS_SDRAM_BASE,
|
||||
CFG_SYS_SDRAM_SIZE);
|
||||
return 0;
|
||||
return fdtdec_setup_mem_size_base();
|
||||
}
|
||||
|
||||
/* SPL */
|
||||
|
||||
73
configs/sam9x75_curiosity_mmc_defconfig
Normal file
73
configs/sam9x75_curiosity_mmc_defconfig
Normal file
@@ -0,0 +1,73 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
CONFIG_ARCH_AT91=y
|
||||
CONFIG_TEXT_BASE=0x23f00000
|
||||
CONFIG_SYS_MALLOC_LEN=0x81000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x12000
|
||||
CONFIG_TARGET_SAM9X75_CURIOSITY=y
|
||||
CONFIG_ATMEL_LEGACY=y
|
||||
CONFIG_NR_DRAM_BANKS=8
|
||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20015f00
|
||||
CONFIG_ENV_SIZE=0x4000
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="microchip/at91-sam9x75_curiosity"
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x22000000
|
||||
CONFIG_DEBUG_UART_BASE=0xfffff200
|
||||
CONFIG_DEBUG_UART_CLOCK=266666666
|
||||
CONFIG_DEBUG_UART_BOARD_INIT=y
|
||||
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_USE_BOOTCOMMAND=y
|
||||
CONFIG_BOOTCOMMAND="fatload mmc 0:1 0x21000000 at91-sam9x75_curiosity.dtb; fatload mmc 0:1 0x22000000 zImage; bootz 0x22000000 - 0x21000000"
|
||||
CONFIG_SYS_CBSIZE=256
|
||||
CONFIG_SYS_PBSIZE=281
|
||||
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_CLK=y
|
||||
CONFIG_CMD_DM=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
CONFIG_BOOTP_BOOTFILESIZE=y
|
||||
CONFIG_CMD_DHCP=y
|
||||
CONFIG_CMD_MII=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_HASH=y
|
||||
CONFIG_HASH_VERIFY=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_OF_CONTROL=y
|
||||
CONFIG_ENV_IS_IN_FAT=y
|
||||
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_CLK=y
|
||||
CONFIG_CLK_CCF=y
|
||||
CONFIG_CLK_AT91=y
|
||||
CONFIG_AT91_GENERIC_CLK=y
|
||||
CONFIG_AT91_SAM9X60_PLL=y
|
||||
CONFIG_CPU=y
|
||||
CONFIG_AT91_GPIO=y
|
||||
CONFIG_DM_I2C=y
|
||||
CONFIG_SYS_I2C_AT91=y
|
||||
CONFIG_I2C_EEPROM=y
|
||||
CONFIG_MICROCHIP_FLEXCOM=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_ATMEL=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_AT91=y
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_DEBUG_UART_ANNOUNCE=y
|
||||
CONFIG_ATMEL_USART=y
|
||||
CONFIG_TIMER=y
|
||||
CONFIG_MCHP_PIT64B_TIMER=y
|
||||
CONFIG_PHANDLE_CHECK_SEQ=y
|
||||
@@ -12,6 +12,7 @@ obj-$(CONFIG_AT91_SAM9X60_PLL) += clk-sam9x60-pll.o
|
||||
obj-$(CONFIG_AT91_SAM9X60_USB) += clk-sam9x60-usb.o
|
||||
obj-$(CONFIG_SAMA7G5) += sama7g5.o
|
||||
obj-$(CONFIG_SAM9X60) += sam9x60.o
|
||||
obj-$(CONFIG_SAM9X7) += sam9x7.o
|
||||
else
|
||||
obj-y += compat.o
|
||||
endif
|
||||
|
||||
@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
|
||||
if (!reg || !name || !parent_name)
|
||||
if (!reg || !name)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
main_rc = kzalloc(sizeof(*main_rc), GFP_KERNEL);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#define UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL "at91-sam9x60-div-pll-clk"
|
||||
#define UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL "at91-sam9x60-frac-pll-clk"
|
||||
#define UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL "at91-sam9x60-fixed-div-pll-clk"
|
||||
|
||||
#define PMC_PLL_CTRL0_DIV_MSK GENMASK(7, 0)
|
||||
#define PMC_PLL_CTRL1_MUL_MSK GENMASK(31, 24)
|
||||
@@ -31,9 +32,6 @@
|
||||
#define UPLL_DIV 2
|
||||
#define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
|
||||
|
||||
#define FCORE_MIN (600000000)
|
||||
#define FCORE_MAX (1200000000)
|
||||
|
||||
#define PLL_MAX_ID 7
|
||||
|
||||
struct sam9x60_pll {
|
||||
@@ -55,14 +53,15 @@ static inline bool sam9x60_pll_ready(void __iomem *base, int id)
|
||||
return !!(status & BIT(id));
|
||||
}
|
||||
|
||||
static long sam9x60_frac_pll_compute_mul_frac(u32 *mul, u32 *frac, ulong rate,
|
||||
static long sam9x60_frac_pll_compute_mul_frac(const struct clk_range *core_clk,
|
||||
u32 *mul, u32 *frac, ulong rate,
|
||||
ulong parent_rate)
|
||||
{
|
||||
unsigned long tmprate, remainder;
|
||||
unsigned long nmul = 0;
|
||||
unsigned long nfrac = 0;
|
||||
|
||||
if (rate < FCORE_MIN || rate > FCORE_MAX)
|
||||
if (rate < core_clk->min || rate > core_clk->max)
|
||||
return -ERANGE;
|
||||
|
||||
/*
|
||||
@@ -82,7 +81,7 @@ static long sam9x60_frac_pll_compute_mul_frac(u32 *mul, u32 *frac, ulong rate,
|
||||
}
|
||||
|
||||
/* Check if resulted rate is valid. */
|
||||
if (tmprate < FCORE_MIN || tmprate > FCORE_MAX)
|
||||
if (tmprate < core_clk[0].min || tmprate > core_clk[0].max)
|
||||
return -ERANGE;
|
||||
|
||||
*mul = nmul - 1;
|
||||
@@ -103,8 +102,8 @@ static ulong sam9x60_frac_pll_set_rate(struct clk *clk, ulong rate)
|
||||
if (!parent_rate)
|
||||
return 0;
|
||||
|
||||
ret = sam9x60_frac_pll_compute_mul_frac(&nmul, &nfrac, rate,
|
||||
parent_rate);
|
||||
ret = sam9x60_frac_pll_compute_mul_frac(pll->characteristics->core_output,
|
||||
&nmul, &nfrac, rate, parent_rate);
|
||||
if (ret < 0)
|
||||
return 0;
|
||||
|
||||
@@ -142,6 +141,7 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)
|
||||
void __iomem *base = pll->base;
|
||||
ulong parent_rate = clk_get_parent_rate(clk);
|
||||
u32 mul, frac, val;
|
||||
ulong pll_rate;
|
||||
|
||||
if (!parent_rate)
|
||||
return 0;
|
||||
@@ -151,8 +151,12 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)
|
||||
pmc_read(base, AT91_PMC_PLL_CTRL1, &val);
|
||||
mul = (val & pll->layout->mul_mask) >> pll->layout->mul_shift;
|
||||
frac = (val & pll->layout->frac_mask) >> pll->layout->frac_shift;
|
||||
pll_rate = (parent_rate * (mul + 1) + ((u64)parent_rate * frac >> 22));
|
||||
|
||||
return (parent_rate * (mul + 1) + ((u64)parent_rate * frac >> 22));
|
||||
if (pll->layout->div2)
|
||||
pll_rate >>= 1;
|
||||
|
||||
return pll_rate;
|
||||
}
|
||||
|
||||
static int sam9x60_frac_pll_enable(struct clk *clk)
|
||||
@@ -163,7 +167,8 @@ static int sam9x60_frac_pll_enable(struct clk *clk)
|
||||
ulong crate;
|
||||
|
||||
crate = sam9x60_frac_pll_get_rate(clk);
|
||||
if (crate < FCORE_MIN || crate > FCORE_MAX)
|
||||
if (crate < pll->characteristics->core_output[0].min ||
|
||||
crate > pll->characteristics->core_output[0].max)
|
||||
return -ERANGE;
|
||||
|
||||
pmc_update_bits(base, AT91_PMC_PLL_UPDT, AT91_PMC_PLL_UPDT_ID_MSK,
|
||||
@@ -360,6 +365,16 @@ static ulong sam9x60_div_pll_get_rate(struct clk *clk)
|
||||
return parent_rate / (div + 1);
|
||||
}
|
||||
|
||||
static ulong sam9x60_fixed_div_pll_get_rate(struct clk *clk)
|
||||
{
|
||||
ulong parent_rate = clk_get_parent_rate(clk);
|
||||
|
||||
if (!parent_rate)
|
||||
return 0;
|
||||
|
||||
return parent_rate >> 1;
|
||||
}
|
||||
|
||||
static const struct clk_ops sam9x60_div_pll_ops = {
|
||||
.enable = sam9x60_div_pll_enable,
|
||||
.disable = sam9x60_div_pll_disable,
|
||||
@@ -367,6 +382,12 @@ static const struct clk_ops sam9x60_div_pll_ops = {
|
||||
.get_rate = sam9x60_div_pll_get_rate,
|
||||
};
|
||||
|
||||
static const struct clk_ops sam9x60_fixed_div_pll_ops = {
|
||||
.enable = sam9x60_div_pll_enable,
|
||||
.disable = sam9x60_div_pll_disable,
|
||||
.get_rate = sam9x60_fixed_div_pll_get_rate,
|
||||
};
|
||||
|
||||
static struct clk *
|
||||
sam9x60_clk_register_pll(void __iomem *base, const char *type,
|
||||
const char *name, const char *parent_name, u8 id,
|
||||
@@ -407,6 +428,13 @@ sam9x60_clk_register_div_pll(void __iomem *base, const char *name,
|
||||
const struct clk_pll_characteristics *characteristics,
|
||||
const struct clk_pll_layout *layout, bool critical)
|
||||
{
|
||||
if (layout->div2) {
|
||||
return sam9x60_clk_register_pll(base,
|
||||
UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL, name, parent_name,
|
||||
id, characteristics, layout,
|
||||
CLK_GET_RATE_NOCACHE | (critical ? CLK_IS_CRITICAL : 0));
|
||||
}
|
||||
|
||||
return sam9x60_clk_register_pll(base,
|
||||
UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL, name, parent_name, id,
|
||||
characteristics, layout,
|
||||
@@ -432,6 +460,13 @@ U_BOOT_DRIVER(at91_sam9x60_div_pll_clk) = {
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(at91_sam9x60_fixed_div_pll_clk) = {
|
||||
.name = UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL,
|
||||
.id = UCLASS_CLK,
|
||||
.ops = &sam9x60_fixed_div_pll_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(at91_sam9x60_frac_pll_clk) = {
|
||||
.name = UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL,
|
||||
.id = UCLASS_CLK,
|
||||
|
||||
@@ -38,6 +38,7 @@ struct clk_pll_characteristics {
|
||||
struct clk_range input;
|
||||
int num_output;
|
||||
const struct clk_range *output;
|
||||
const struct clk_range *core_output;
|
||||
u16 *icpll;
|
||||
u8 *out;
|
||||
u8 upll : 1;
|
||||
@@ -53,6 +54,7 @@ struct clk_pll_layout {
|
||||
u8 frac_shift;
|
||||
u8 div_shift;
|
||||
u8 endiv_shift;
|
||||
u8 div2;
|
||||
};
|
||||
|
||||
struct clk_programmable_layout {
|
||||
|
||||
@@ -112,17 +112,24 @@ static const struct clk_range upll_outputs[] = {
|
||||
{ .min = 300000000, .max = 500000000 },
|
||||
};
|
||||
|
||||
/* Fractional PLL core output range. */
|
||||
static const struct clk_range core_outputs[] = {
|
||||
{ .min = 600000000, .max = 1200000000 },
|
||||
};
|
||||
|
||||
/* PLL characteristics. */
|
||||
static const struct clk_pll_characteristics apll_characteristics = {
|
||||
.input = { .min = 12000000, .max = 48000000 },
|
||||
.num_output = ARRAY_SIZE(plla_outputs),
|
||||
.output = plla_outputs,
|
||||
.core_output = core_outputs,
|
||||
};
|
||||
|
||||
static const struct clk_pll_characteristics upll_characteristics = {
|
||||
.input = { .min = 12000000, .max = 48000000 },
|
||||
.num_output = ARRAY_SIZE(upll_outputs),
|
||||
.output = upll_outputs,
|
||||
.core_output = core_outputs,
|
||||
.upll = true,
|
||||
};
|
||||
|
||||
|
||||
1085
drivers/clk/at91/sam9x7.c
Normal file
1085
drivers/clk/at91/sam9x7.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -158,11 +158,17 @@ static const struct clk_range pll_outputs[] = {
|
||||
{ .min = 2343750, .max = 1200000000 },
|
||||
};
|
||||
|
||||
/* Fractional PLL core output range. */
|
||||
static const struct clk_range core_outputs[] = {
|
||||
{ .min = 600000000, .max = 1200000000 },
|
||||
};
|
||||
|
||||
/* PLL characteristics. */
|
||||
static const struct clk_pll_characteristics pll_characteristics = {
|
||||
.input = { .min = 12000000, .max = 50000000 },
|
||||
.num_output = ARRAY_SIZE(pll_outputs),
|
||||
.output = pll_outputs,
|
||||
.core_output = core_outputs,
|
||||
};
|
||||
|
||||
/* Layout for fractional PLLs. */
|
||||
|
||||
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
*/
|
||||
static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
|
||||
{
|
||||
struct at91_wdt_priv *priv = dev_get_priv(dev);
|
||||
struct at91_wdt_priv *wdt = dev_get_priv(dev);
|
||||
u64 timeout;
|
||||
u32 ticks;
|
||||
|
||||
@@ -49,7 +49,7 @@ static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
|
||||
ticks = WDT_SEC2TICKS(timeout);
|
||||
|
||||
/* Check if disabled */
|
||||
if (readl(priv->regs + AT91_WDT_MR) & AT91_WDT_MR_WDDIS) {
|
||||
if (readl(wdt->regs + AT91_WDT_MR) & wdt->wddis) {
|
||||
printf("sorry, watchdog is disabled\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -60,31 +60,41 @@ static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
|
||||
* Since WDV is a 12-bit counter, the maximum period is
|
||||
* 4096 / 256 = 16 seconds.
|
||||
*/
|
||||
priv->regval = AT91_WDT_MR_WDRSTEN /* causes watchdog reset */
|
||||
| AT91_WDT_MR_WDDBGHLT /* disabled in debug mode */
|
||||
| AT91_WDT_MR_WDD(0xfff) /* restart at any time */
|
||||
| AT91_WDT_MR_WDV(ticks); /* timer value */
|
||||
writel(priv->regval, priv->regs + AT91_WDT_MR);
|
||||
|
||||
if (wdt->mode == AT91_WDT_MODE_SAM9260) {
|
||||
wdt->mr = AT91_WDT_MR_WDRSTEN /* causes watchdog reset */
|
||||
| AT91_WDT_MR_WDDBGHLT /* disabled in debug mode */
|
||||
| AT91_WDT_MR_WDD(0xfff) /* restart at any time */
|
||||
| AT91_WDT_MR_WDV(ticks); /* timer value */
|
||||
writel(wdt->mr, wdt->regs + AT91_WDT_MR);
|
||||
} else if (wdt->mode == AT91_WDT_MODE_SAM9X60) {
|
||||
writel(AT91_SAM9X60_WLR_COUNTER(ticks), /* timer value */
|
||||
wdt->regs + AT91_SAM9X60_WLR);
|
||||
|
||||
wdt->mr = AT91_SAM9X60_MR_PERIODRST /* causes watchdog reset */
|
||||
| AT91_SAM9X60_MR_WDDBGHLT; /* disabled in debug mode */
|
||||
writel(wdt->mr, wdt->regs + AT91_WDT_MR);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int at91_wdt_stop(struct udevice *dev)
|
||||
{
|
||||
struct at91_wdt_priv *priv = dev_get_priv(dev);
|
||||
struct at91_wdt_priv *wdt = dev_get_priv(dev);
|
||||
|
||||
/* Disable Watchdog Timer */
|
||||
priv->regval |= AT91_WDT_MR_WDDIS;
|
||||
writel(priv->regval, priv->regs + AT91_WDT_MR);
|
||||
wdt->mr |= wdt->wddis;
|
||||
writel(wdt->mr, wdt->regs + AT91_WDT_MR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int at91_wdt_reset(struct udevice *dev)
|
||||
{
|
||||
struct at91_wdt_priv *priv = dev_get_priv(dev);
|
||||
struct at91_wdt_priv *wdt = dev_get_priv(dev);
|
||||
|
||||
writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, priv->regs + AT91_WDT_CR);
|
||||
writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt->regs + AT91_WDT_CR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -96,18 +106,31 @@ static const struct wdt_ops at91_wdt_ops = {
|
||||
};
|
||||
|
||||
static const struct udevice_id at91_wdt_ids[] = {
|
||||
{ .compatible = "atmel,at91sam9260-wdt" },
|
||||
{ .compatible = "atmel,at91sam9260-wdt",
|
||||
.data = AT91_WDT_MODE_SAM9260 },
|
||||
{ .compatible = "atmel,sama5d4-wdt",
|
||||
.data = AT91_WDT_MODE_SAM9260 },
|
||||
{ .compatible = "microchip,sam9x60-wdt",
|
||||
.data = AT91_WDT_MODE_SAM9X60 },
|
||||
{ .compatible = "microchip,sama7g5-wdt",
|
||||
.data = AT91_WDT_MODE_SAM9X60 },
|
||||
{}
|
||||
};
|
||||
|
||||
static int at91_wdt_probe(struct udevice *dev)
|
||||
{
|
||||
struct at91_wdt_priv *priv = dev_get_priv(dev);
|
||||
struct at91_wdt_priv *wdt = dev_get_priv(dev);
|
||||
|
||||
priv->regs = dev_remap_addr(dev);
|
||||
if (!priv->regs)
|
||||
wdt->regs = dev_remap_addr(dev);
|
||||
if (!wdt->regs)
|
||||
return -EINVAL;
|
||||
|
||||
wdt->mode = dev_get_driver_data(dev);
|
||||
if (wdt->mode == AT91_WDT_MODE_SAM9260)
|
||||
wdt->wddis = AT91_WDT_MR_WDDIS;
|
||||
else if (wdt->mode == AT91_WDT_MODE_SAM9X60)
|
||||
wdt->wddis = AT91_SAM9X60_MR_WDDIS;
|
||||
|
||||
debug("%s: Probing wdt%u\n", __func__, dev_seq(dev));
|
||||
|
||||
return 0;
|
||||
|
||||
23
include/configs/sam9x75_curiosity.h
Normal file
23
include/configs/sam9x75_curiosity.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Configuration settings for the SAM9X75 CURIOSITY board.
|
||||
*
|
||||
* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
|
||||
*
|
||||
* Author: Manikandan Muralidharan <manikandan.m@microchip.com>
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
|
||||
#define CFG_SYS_AT91_SLOW_CLOCK 32768
|
||||
#define CFG_SYS_AT91_MAIN_CLOCK 24000000 /* 24 MHz crystal */
|
||||
|
||||
#define CFG_USART_BASE ATMEL_BASE_DBGU
|
||||
#define CFG_USART_ID 0 /* ignored in arm */
|
||||
|
||||
/* SDRAM */
|
||||
#define CFG_SYS_SDRAM_BASE 0x20000000
|
||||
#define CFG_SYS_SDRAM_SIZE 0x10000000 /* 256 megs */
|
||||
|
||||
#endif
|
||||
@@ -15,10 +15,4 @@
|
||||
#undef CFG_SYS_AT91_MAIN_CLOCK
|
||||
#define CFG_SYS_AT91_MAIN_CLOCK 24000000 /* from 24 MHz crystal */
|
||||
|
||||
/* SDRAM */
|
||||
#define CFG_SYS_SDRAM_BASE 0x20000000
|
||||
#define CFG_SYS_SDRAM_SIZE 0x10000000
|
||||
|
||||
/* SPL */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user