From 640aecb416cff52cf8a89d786d41e6eee54c94ff Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 22 Nov 2022 12:54:52 -0500 Subject: rtc: Add fallbacks for dm functions This adds fallbacks for the various dm_rtc_* functions. This allows common code to use these functions without ifdefs. Fixes: c8ce7ba87d1 ("misc: Add support for nvmem cells") Reviewed-by: Simon Glass Signed-off-by: Sean Anderson --- include/rtc.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/rtc.h b/include/rtc.h index 10104e3bf5a..b6fdbb60dc2 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -15,13 +15,12 @@ #include #include +#include typedef int64_t time64_t; - -#ifdef CONFIG_DM_RTC - struct udevice; +#if CONFIG_IS_ENABLED(DM_RTC) struct rtc_ops { /** * get() - get the current time @@ -222,6 +221,33 @@ int rtc_enable_32khz_output(int busnum, int chip_addr); #endif #else +static inline int dm_rtc_get(struct udevice *dev, struct rtc_time *time) +{ + return -ENOSYS; +} + +static inline int dm_rtc_set(struct udevice *dev, struct rtc_time *time) +{ + return -ENOSYS; +} + +static inline int dm_rtc_reset(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int dm_rtc_read(struct udevice *dev, unsigned int reg, u8 *buf, + unsigned int len) +{ + return -ENOSYS; +} + +static inline int dm_rtc_write(struct udevice *dev, unsigned int reg, + const u8 *buf, unsigned int len) +{ + return -ENOSYS; +} + int rtc_get (struct rtc_time *); int rtc_set (struct rtc_time *); void rtc_reset (void); -- cgit v1.2.3 From 253802912a65fde6ba9328462ef4b8574932c8f3 Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Thu, 3 Nov 2022 19:13:51 -0500 Subject: arm: dts: introduce am62a7 dtbs from linux kernel Introduce the basic am62a7 SoC dtbs from the v6.1-rc3 tag of the linux kernel along with the new am62a specific pinmux definition that we will use to generate the dtbs for the u-boot-spl and u-boot binaries Co-developed-by: Vignesh Raghavendra Signed-off-by: Vignesh Raghavendra Signed-off-by: Bryan Brattlof --- include/dt-bindings/pinctrl/k3.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h index a5204ab91d3..e8418318eb9 100644 --- a/include/dt-bindings/pinctrl/k3.h +++ b/include/dt-bindings/pinctrl/k3.h @@ -44,4 +44,7 @@ #define AM62X_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) #define AM62X_MCU_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) +#define AM62AX_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) +#define AM62AX_MCU_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) + #endif -- cgit v1.2.3 From b6cbcd61556e0d9de4c389071e3a826e577b9f43 Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Thu, 3 Nov 2022 19:13:56 -0500 Subject: arm: mach-k3: am62a: introduce auto-generated SoC data Introduce the auto-generated clock tree and power domain data needed to attach the am62a into the power-domain and clock frameworks of uboot Signed-off-by: Bryan Brattlof --- include/k3-clk.h | 1 + include/k3-dev.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/k3-clk.h b/include/k3-clk.h index 371f077c447..49ba53d20f7 100644 --- a/include/k3-clk.h +++ b/include/k3-clk.h @@ -175,6 +175,7 @@ extern const struct ti_k3_clk_platdata j721e_clk_platdata; extern const struct ti_k3_clk_platdata j7200_clk_platdata; extern const struct ti_k3_clk_platdata j721s2_clk_platdata; extern const struct ti_k3_clk_platdata am62x_clk_platdata; +extern const struct ti_k3_clk_platdata am62ax_clk_platdata; struct clk *clk_register_ti_pll(const char *name, const char *parent_name, void __iomem *reg); diff --git a/include/k3-dev.h b/include/k3-dev.h index 87e873b9ced..d288ae3be73 100644 --- a/include/k3-dev.h +++ b/include/k3-dev.h @@ -79,6 +79,7 @@ extern const struct ti_k3_pd_platdata j721e_pd_platdata; extern const struct ti_k3_pd_platdata j7200_pd_platdata; extern const struct ti_k3_pd_platdata j721s2_pd_platdata; extern const struct ti_k3_pd_platdata am62x_pd_platdata; +extern const struct ti_k3_pd_platdata am62ax_pd_platdata; u8 ti_pd_state(struct ti_pd *pd); u8 lpsc_get_state(struct ti_lpsc *lpsc); -- cgit v1.2.3 From 719bd650c30e86d43c9a6c1e289e82db802b0d3c Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Thu, 3 Nov 2022 19:13:58 -0500 Subject: configs: introduce configs for the am62a Introduce the minimum configs, only SD-MMC and UART boot related settings, to serve as a good starting point for the am62a as we add more functionality. Signed-off-by: Bryan Brattlof [trini: Disable CONFIG_NET as it's not used, in both platforms] Signed-off-by: Tom Rini --- include/configs/am62ax_evm.h | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 include/configs/am62ax_evm.h (limited to 'include') diff --git a/include/configs/am62ax_evm.h b/include/configs/am62ax_evm.h new file mode 100644 index 00000000000..5406c39350f --- /dev/null +++ b/include/configs/am62ax_evm.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Configuration header file for K3 AM62Ax SoC family + * + * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ + */ + +#ifndef __CONFIG_AM62AX_EVM_H +#define __CONFIG_AM62AX_EVM_H + +#include +#include +#include +#include + +/* DDR Configuration */ +#define CFG_SYS_SDRAM_BASE1 0x880000000 + +#define PARTS_DEFAULT \ + /* Linux partitions */ \ + "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \ + +/* U-Boot general configuration */ +#define EXTRA_ENV_AM62A7_BOARD_SETTINGS \ + "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "findfdt=" \ + "setenv name_fdt ${default_device_tree};" \ + "setenv fdtfile ${name_fdt}\0" \ + "name_kern=Image\0" \ + "console=ttyS2,115200n8\0" \ + "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \ + "${mtdparts}\0" \ + "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" + +/* U-Boot MMC-specific configuration */ +#define EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC \ + "boot=mmc\0" \ + "mmcdev=1\0" \ + "bootpart=1:2\0" \ + "bootdir=/boot\0" \ + "rd_spec=-\0" \ + "init_mmc=run args_all args_mmc\0" \ + "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \ + "get_overlay_mmc=" \ + "fdt address ${fdtaddr};" \ + "fdt resize 0x100000;" \ + "for overlay in $name_overlays;" \ + "do;" \ + "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ + "fdt apply ${dtboaddr};" \ + "done;\0" \ + "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ + "${bootdir}/${name_kern}\0" \ + "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ + "${bootdir}/${name_fit}\0" \ + "partitions=" PARTS_DEFAULT + +/* Incorporate settings into the U-Boot environment */ +#define CONFIG_EXTRA_ENV_SETTINGS \ + DEFAULT_LINUX_BOOT_ENV \ + DEFAULT_MMC_TI_ARGS \ + EXTRA_ENV_AM62A7_BOARD_SETTINGS \ + EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC \ + +/* Now for the remaining common defines */ +#include + +#endif /* __CONFIG_AM62A7_EVM_H */ -- cgit v1.2.3