Merge patch series "board: ti: Add 32k crystal initialization"
Vishal Mahaveer <vishalm@ti.com> says: Add 32k crystal initialization support for am62x, am62ax and am62px TI boards. Link: https://lore.kernel.org/r/20260121195340.3041549-1-vishalm@ti.com
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <asm/arch/k3-ddr.h>
|
||||
|
||||
#include "../common/fdt_ops.h"
|
||||
#include "../common/k3_32k_lfosc.h"
|
||||
|
||||
#if defined(CONFIG_XPL_BUILD)
|
||||
void spl_perform_board_fixups(struct spl_image_info *spl_image)
|
||||
@@ -26,6 +27,12 @@ void spl_perform_board_fixups(struct spl_image_info *spl_image)
|
||||
fixup_memory_node(spl_image);
|
||||
}
|
||||
}
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_TI_K3_BOARD_LFOSC))
|
||||
enable_32k_lfosc();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <asm/arch/k3-ddr.h>
|
||||
|
||||
#include "../common/fdt_ops.h"
|
||||
#include "../common/k3_32k_lfosc.h"
|
||||
|
||||
#if defined(CONFIG_XPL_BUILD)
|
||||
void spl_perform_board_fixups(struct spl_image_info *spl_image)
|
||||
@@ -26,6 +27,12 @@ void spl_perform_board_fixups(struct spl_image_info *spl_image)
|
||||
fixup_memory_node(spl_image);
|
||||
}
|
||||
}
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_TI_K3_BOARD_LFOSC))
|
||||
enable_32k_lfosc();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <spl.h>
|
||||
#include <asm/arch/k3-ddr.h>
|
||||
#include "../common/fdt_ops.h"
|
||||
#include "../common/k3_32k_lfosc.h"
|
||||
|
||||
struct efi_fw_image fw_images[] = {
|
||||
{
|
||||
@@ -45,6 +46,9 @@ struct efi_capsule_update_info update_info = {
|
||||
#if IS_ENABLED(CONFIG_SPL_BUILD)
|
||||
void spl_board_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_TI_K3_BOARD_LFOSC))
|
||||
enable_32k_lfosc();
|
||||
|
||||
enable_caches();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "../common/board_detect.h"
|
||||
#include "../common/fdt_ops.h"
|
||||
#include "../common/k3_32k_lfosc.h"
|
||||
|
||||
#define board_is_am62x_skevm() (board_ti_k3_is("AM62-SKEVM") || \
|
||||
board_ti_k3_is("AM62B-SKEVM"))
|
||||
@@ -139,6 +140,9 @@ int board_late_init(void)
|
||||
#if defined(CONFIG_XPL_BUILD)
|
||||
void spl_board_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_TI_K3_BOARD_LFOSC))
|
||||
enable_32k_lfosc();
|
||||
|
||||
enable_caches();
|
||||
if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
|
||||
splash_display();
|
||||
|
||||
@@ -22,6 +22,11 @@ config CAPE_EEPROM_BUS_NUM
|
||||
default 2
|
||||
depends on SUPPORT_EXTENSION_SCAN
|
||||
|
||||
config TI_K3_BOARD_LFOSC
|
||||
bool "Initialize 32k LFOSC"
|
||||
help
|
||||
Enable the 32k LFOSC on the device
|
||||
|
||||
config TI_COMMON_CMD_OPTIONS
|
||||
bool "Enable cmd options on TI platforms"
|
||||
imply CMD_ASKENV
|
||||
|
||||
@@ -5,3 +5,4 @@ obj-${CONFIG_TI_I2C_BOARD_DETECT} += board_detect.o
|
||||
obj-${CONFIG_$(PHASE_)SUPPORT_EXTENSION_SCAN} += cape_detect.o
|
||||
obj-${CONFIG_OF_LIBFDT} += fdt_ops.o
|
||||
obj-${CONFIG_ARCH_K3} += k3-ddr.o
|
||||
obj-${CONFIG_TI_K3_BOARD_LFOSC} += k3_32k_lfosc.o
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Library to support LFOSC operations common to some of the K3 devices
|
||||
*
|
||||
* Copyright (C) 2026 Texas Instruments Incorporated - https://www.ti.com/
|
||||
*/
|
||||
|
||||
#include <asm/arch/hardware.h>
|
||||
|
||||
void enable_32k_lfosc(void)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/* We have 32k crystal, so lets enable it */
|
||||
val = readl(MCU_CTRL_LFXOSC_CTRL);
|
||||
val &= ~(MCU_CTRL_LFXOSC_32K_DISABLE_VAL);
|
||||
writel(val, MCU_CTRL_LFXOSC_CTRL);
|
||||
/* Add any TRIM needed for the crystal here.. */
|
||||
/* Make sure to mux up to take the SoC 32k from the crystal */
|
||||
writel(MCU_CTRL_DEVICE_CLKOUT_LFOSC_SELECT_VAL,
|
||||
MCU_CTRL_DEVICE_CLKOUT_32K_CTRL);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Library to support LFOSC operations common to some of the K3 devices
|
||||
*
|
||||
* Copyright (C) 2026 Texas Instruments Incorporated - https://www.ti.com/
|
||||
*/
|
||||
#ifndef __32K_LFOSC_OPS_H
|
||||
#define __32K_LFOSC_OPS_H
|
||||
|
||||
/**
|
||||
* enable_32k_lfosc - Do basic initialization of the 32k crystal
|
||||
*/
|
||||
void enable_32k_lfosc(void);
|
||||
|
||||
#endif /* __32K_LFOSC_OPS_H */
|
||||
@@ -103,3 +103,5 @@ CONFIG_SPL_TIMER=y
|
||||
CONFIG_OMAP_TIMER=y
|
||||
CONFIG_LIB_RATIONAL=y
|
||||
CONFIG_SPL_LIB_RATIONAL=y
|
||||
CONFIG_SPL_BOARD_INIT=y
|
||||
CONFIG_TI_K3_BOARD_LFOSC=y
|
||||
|
||||
@@ -122,3 +122,5 @@ CONFIG_SPL_TIMER=y
|
||||
CONFIG_OMAP_TIMER=y
|
||||
CONFIG_LIB_RATIONAL=y
|
||||
CONFIG_SPL_LIB_RATIONAL=y
|
||||
CONFIG_SPL_BOARD_INIT=y
|
||||
CONFIG_TI_K3_BOARD_LFOSC=y
|
||||
|
||||
@@ -119,3 +119,5 @@ CONFIG_SPL_TIMER=y
|
||||
CONFIG_OMAP_TIMER=y
|
||||
CONFIG_LIB_RATIONAL=y
|
||||
CONFIG_SPL_LIB_RATIONAL=y
|
||||
CONFIG_SPL_BOARD_INIT=y
|
||||
CONFIG_TI_K3_BOARD_LFOSC=y
|
||||
|
||||
Reference in New Issue
Block a user