diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 19:20:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 19:20:54 +0000 |
commit | 9cf27fc03a2eaf3d91167db54c19bad8652ac085 (patch) | |
tree | 42f079ff82e701ebcb76829974b4caca3e5b6798 /arch/arm/mach-omap2 | |
parent | Adding upstream version 6.8.12. (diff) | |
download | linux-9cf27fc03a2eaf3d91167db54c19bad8652ac085.tar.xz linux-9cf27fc03a2eaf3d91167db54c19bad8652ac085.zip |
Adding upstream version 6.9.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/am33xx-restart.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm33xx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap-secure.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_common_data.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pmic-cpcap.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm-regbits-33xx.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm33xx.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/wd_timer.c | 4 |
17 files changed, 66 insertions, 40 deletions
diff --git a/arch/arm/mach-omap2/am33xx-restart.c b/arch/arm/mach-omap2/am33xx-restart.c index ef2f18a56b..fcf3d557aa 100644 --- a/arch/arm/mach-omap2/am33xx-restart.c +++ b/arch/arm/mach-omap2/am33xx-restart.c @@ -9,7 +9,7 @@ #include "prm.h" /** - * am3xx_restart - trigger a software restart of the SoC + * am33xx_restart - trigger a software restart of the SoC * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c * @cmd: passed from the userspace program rebooting the system (if provided) * @@ -18,7 +18,8 @@ */ void am33xx_restart(enum reboot_mode mode, const char *cmd) { - /* TODO: Handle mode and cmd if necessary */ + /* TODO: Handle cmd if necessary */ + prm_reboot_mode = mode; omap_prm_reset_system(); } diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index fde6ccb3df..68e0baad2b 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -246,6 +246,12 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") .init_time = omap_init_time_of, .dt_compat = am33xx_boards_compat, .restart = am33xx_restart, + /* + * Historically am33xx supported only REBOOT_WARM even though default + * reboot_mode was REBOOT_COLD. Reflect legacy de-facto behaviour in + * SYSFS. + */ + .reboot_mode = REBOOT_WARM, MACHINE_END #endif diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index be4557d1fd..011076a595 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -162,7 +162,7 @@ static int omap2_select_table_rate(struct clk_hw *hw, unsigned long rate, } /** - * omap2xxx_clkt_vps_check_bootloader_rate - determine which of the rate + * omap2xxx_clkt_vps_check_bootloader_rates - determine which of the rate * table sets matches the current CORE DPLL hardware rate * * Check the MPU rate set by bootloader. Sets the 'curr_prcm_set' diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index d145e7ac70..69dc5b8393 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c @@ -990,7 +990,7 @@ void clkdm_allow_idle(struct clockdomain *clkdm) } /** - * clkdm_deny_idle - disable hwsup idle transitions for clkdm + * clkdm_deny_idle_nolock - disable hwsup idle transitions for clkdm * @clkdm: struct clockdomain * * * Prevent the hardware from automatically switching the clockdomain @@ -1110,7 +1110,7 @@ void clkdm_del_autodeps(struct clockdomain *clkdm) /** * clkdm_clk_enable - add an enabled downstream clock to this clkdm * @clkdm: struct clockdomain * - * @clk: struct clk * of the enabled downstream clock + * @unused: struct clk * of the enabled downstream clock * * Increment the usecount of the clockdomain @clkdm and ensure that it * is awake before @clk is enabled. Intended to be called by diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index c824d4e3db..acdf72a541 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -357,7 +357,7 @@ static int am33xx_clkdm_save_context(struct clockdomain *clkdm) } /** - * am33xx_restore_save_context - Restore the clockdomain transition context + * am33xx_clkdm_restore_context - Restore the clockdomain transition context * @clkdm: The clockdomain pointer whose context needs to be restored * * Restore the clockdomain transition context. diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 46670521b2..49483a8880 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c @@ -237,7 +237,7 @@ static void omap4_cminst_clkdm_disable_hwsup(u8 part, u16 inst, u16 cdoffs) } /** - * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle + * omap4_cminst_clkdm_force_wakeup - try to take a clockdomain out of idle * @part: PRCM partition ID that the clockdomain registers exist in * @inst: CM instance register offset (*_INST macro) * @cdoffs: Clockdomain register offset (*_CDOFFS macro) diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c index 29c7350b06..c2e1aecd07 100644 --- a/arch/arm/mach-omap2/omap-secure.c +++ b/arch/arm/mach-omap2/omap-secure.c @@ -47,7 +47,7 @@ static void __init omap_optee_init_check(void) } /** - * omap_sec_dispatcher: Routine to dispatch low power secure + * omap_secure_dispatcher - Routine to dispatch low power secure * service routines * @idx: The HAL API index * @flag: The flag indicating criticality of operation @@ -183,7 +183,7 @@ static u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs, /** * rx51_secure_update_aux_cr: Routine to modify the contents of Auxiliary Control Register * @set_bits: bits to set in ACR - * @clr_bits: bits to clear in ACR + * @clear_bits: bits to clear in ACR * * Return the non-zero error value on failure. */ diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index ba71928c0f..111677878d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -900,7 +900,7 @@ static int _init_interface_clks(struct omap_hwmod *oh) } /** - * _init_opt_clk - get a struct clk * for the hwmod's optional clocks + * _init_opt_clks - get a struct clk * for the hwmod's optional clocks * @oh: struct omap_hwmod * * * Called from _init_clocks(). Populates the @oh omap_hwmod_opt_clk @@ -2297,7 +2297,7 @@ static void __init parse_module_flags(struct omap_hwmod *oh, /** * _init - initialize internal data for the hwmod @oh * @oh: struct omap_hwmod * - * @n: (unused) + * @data: (unused) * * Look up the clocks and the address space used by the MPU to access * registers belonging to the hwmod @oh. @oh must already be @@ -2493,7 +2493,7 @@ static void _setup_postsetup(struct omap_hwmod *oh) /** * _setup - prepare IP block hardware for use * @oh: struct omap_hwmod * - * @n: (unused, pass NULL) + * @data: (unused, pass NULL) * * Configure the IP block represented by @oh. This may include * enabling the IP block, resetting it, and placing it into a @@ -3367,8 +3367,9 @@ static int omap_hwmod_check_module(struct device *dev, * omap_hwmod_allocate_module - allocate new module * @dev: struct device * @oh: module + * @data: module data * @sysc_fields: sysc register bits - * @clockdomain: clockdomain + * @clkdm: clockdomain * @rev_offs: revision register offset * @sysc_offs: sysconfig register offset * @syss_offs: sysstatus register offset diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c index 246f1e5da9..439232233c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c @@ -20,7 +20,7 @@ #include "omap_hwmod_common_data.h" -/** +/* * struct omap_hwmod_sysc_type1 - TYPE1 sysconfig scheme. * * To be used by hwmod structure to specify the sysconfig offsets @@ -36,7 +36,7 @@ struct sysc_regbits omap_hwmod_sysc_type1 = { .autoidle_shift = SYSC_TYPE1_AUTOIDLE_SHIFT, }; -/** +/* * struct omap_hwmod_sysc_type2 - TYPE2 sysconfig scheme. * * To be used by hwmod structure to specify the sysconfig offsets if the @@ -50,7 +50,7 @@ struct sysc_regbits omap_hwmod_sysc_type2 = { .dmadisable_shift = SYSC_TYPE2_DMADISABLE_SHIFT, }; -/** +/* * struct omap_hwmod_sysc_type3 - TYPE3 sysconfig scheme. * Used by some IPs on AM33xx */ diff --git a/arch/arm/mach-omap2/pmic-cpcap.c b/arch/arm/mach-omap2/pmic-cpcap.c index 668dc84fd3..4f31e61c0c 100644 --- a/arch/arm/mach-omap2/pmic-cpcap.c +++ b/arch/arm/mach-omap2/pmic-cpcap.c @@ -18,10 +18,10 @@ #include "vc.h" /** - * omap_cpcap_vsel_to_vdc - convert CPCAP VSEL value to microvolts DC + * omap_cpcap_vsel_to_uv - convert CPCAP VSEL value to microvolts DC * @vsel: CPCAP VSEL value to convert * - * Returns the microvolts DC that the CPCAP PMIC should generate when + * Returns: the microvolts DC that the CPCAP PMIC should generate when * programmed with @vsel. */ static unsigned long omap_cpcap_vsel_to_uv(unsigned char vsel) @@ -35,7 +35,7 @@ static unsigned long omap_cpcap_vsel_to_uv(unsigned char vsel) * omap_cpcap_uv_to_vsel - convert microvolts DC to CPCAP VSEL value * @uv: microvolts DC to convert * - * Returns the VSEL value necessary for the CPCAP PMIC to + * Returns: the VSEL value necessary for the CPCAP PMIC to * generate an output voltage equal to or greater than @uv microvolts DC. */ static unsigned char omap_cpcap_uv_to_vsel(unsigned long uv) @@ -82,10 +82,10 @@ static struct omap_voltdm_pmic omap_cpcap_iva = { }; /** - * omap_max8952_vsel_to_vdc - convert MAX8952 VSEL value to microvolts DC + * omap_max8952_vsel_to_uv - convert MAX8952 VSEL value to microvolts DC * @vsel: MAX8952 VSEL value to convert * - * Returns the microvolts DC that the MAX8952 Regulator should generate when + * Returns: the microvolts DC that the MAX8952 Regulator should generate when * programmed with @vsel. */ static unsigned long omap_max8952_vsel_to_uv(unsigned char vsel) @@ -99,7 +99,7 @@ static unsigned long omap_max8952_vsel_to_uv(unsigned char vsel) * omap_max8952_uv_to_vsel - convert microvolts DC to MAX8952 VSEL value * @uv: microvolts DC to convert * - * Returns the VSEL value necessary for the MAX8952 Regulator to + * Returns: the VSEL value necessary for the MAX8952 Regulator to * generate an output voltage equal to or greater than @uv microvolts DC. */ static unsigned char omap_max8952_uv_to_vsel(unsigned long uv) @@ -129,10 +129,10 @@ static struct omap_voltdm_pmic omap443x_max8952_mpu = { }; /** - * omap_fan5355_vsel_to_vdc - convert FAN535503 VSEL value to microvolts DC + * omap_fan535503_vsel_to_uv - convert FAN535503 VSEL value to microvolts DC * @vsel: FAN535503 VSEL value to convert * - * Returns the microvolts DC that the FAN535503 Regulator should generate when + * Returns: the microvolts DC that the FAN535503 Regulator should generate when * programmed with @vsel. */ static unsigned long omap_fan535503_vsel_to_uv(unsigned char vsel) @@ -144,10 +144,10 @@ static unsigned long omap_fan535503_vsel_to_uv(unsigned char vsel) } /** - * omap_fan535508_vsel_to_vdc - convert FAN535508 VSEL value to microvolts DC + * omap_fan535508_vsel_to_uv - convert FAN535508 VSEL value to microvolts DC * @vsel: FAN535508 VSEL value to convert * - * Returns the microvolts DC that the FAN535508 Regulator should generate when + * Returns: the microvolts DC that the FAN535508 Regulator should generate when * programmed with @vsel. */ static unsigned long omap_fan535508_vsel_to_uv(unsigned char vsel) @@ -165,7 +165,7 @@ static unsigned long omap_fan535508_vsel_to_uv(unsigned char vsel) * omap_fan535503_uv_to_vsel - convert microvolts DC to FAN535503 VSEL value * @uv: microvolts DC to convert * - * Returns the VSEL value necessary for the MAX8952 Regulator to + * Returns: the VSEL value necessary for the MAX8952 Regulator to * generate an output voltage equal to or greater than @uv microvolts DC. */ static unsigned char omap_fan535503_uv_to_vsel(unsigned long uv) @@ -184,7 +184,7 @@ static unsigned char omap_fan535503_uv_to_vsel(unsigned long uv) * omap_fan535508_uv_to_vsel - convert microvolts DC to FAN535508 VSEL value * @uv: microvolts DC to convert * - * Returns the VSEL value necessary for the MAX8952 Regulator to + * Returns: the VSEL value necessary for the MAX8952 Regulator to * generate an output voltage equal to or greater than @uv microvolts DC. */ static unsigned char omap_fan535508_uv_to_vsel(unsigned long uv) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 5e05dd1324..2441d96b71 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -1162,7 +1162,7 @@ static int pwrdm_save_context(struct powerdomain *pwrdm, void *unused) } /** - * pwrdm_save_context - restore powerdomain registers + * pwrdm_restore_context - restore powerdomain registers * * Restore powerdomain control registers after a suspend or resume * event. diff --git a/arch/arm/mach-omap2/prm-regbits-33xx.h b/arch/arm/mach-omap2/prm-regbits-33xx.h index 3748c5266a..9b97f8c76c 100644 --- a/arch/arm/mach-omap2/prm-regbits-33xx.h +++ b/arch/arm/mach-omap2/prm-regbits-33xx.h @@ -15,6 +15,7 @@ #define AM33XX_GFX_MEM_STATEST_MASK (0x3 << 4) #define AM33XX_GLOBAL_WARM_SW_RST_MASK (1 << 1) #define AM33XX_RST_GLOBAL_WARM_SW_MASK (1 << 0) +#define AM33XX_RST_GLOBAL_COLD_SW_MASK (1 << 1) #define AM33XX_PRUSS_MEM_ONSTATE_MASK (0x3 << 5) #define AM33XX_PRUSS_MEM_RETSTATE_MASK (1 << 7) #define AM33XX_PRUSS_MEM_STATEST_MASK (0x3 << 23) diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index fc45a7ed09..fc53a27eed 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h @@ -15,6 +15,7 @@ # ifndef __ASSEMBLER__ extern struct omap_domain_base prm_base; extern u16 prm_features; +extern enum reboot_mode prm_reboot_mode; int omap_prcm_init(void); int omap2_prcm_base_init(void); # endif diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c index 4b65a0f9cf..505d685d67 100644 --- a/arch/arm/mach-omap2/prm33xx.c +++ b/arch/arm/mach-omap2/prm33xx.c @@ -10,15 +10,12 @@ #include <linux/errno.h> #include <linux/err.h> #include <linux/io.h> +#include <linux/reboot.h> #include "powerdomain.h" #include "prm33xx.h" #include "prm-regbits-33xx.h" -#define AM33XX_PRM_RSTCTRL_OFFSET 0x0000 - -#define AM33XX_RST_GLOBAL_WARM_SW_MASK (1 << 0) - /* Read a register in a PRM instance */ static u32 am33xx_prm_read_reg(s16 inst, u16 idx) { @@ -322,10 +319,19 @@ static int am33xx_check_vcvp(void) * * Immediately reboots the device through warm reset. */ -static void am33xx_prm_global_warm_sw_reset(void) +static void am33xx_prm_global_sw_reset(void) { - am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK, - AM33XX_RST_GLOBAL_WARM_SW_MASK, + /* + * Historically AM33xx performed warm reset for all requested reboot_mode. + * Keep this behaviour unchanged for all except newly added REBOOT_COLD. + */ + u32 mask = AM33XX_RST_GLOBAL_WARM_SW_MASK; + + if (prm_reboot_mode == REBOOT_COLD) + mask = AM33XX_RST_GLOBAL_COLD_SW_MASK; + + am33xx_prm_rmw_reg_bits(mask, + mask, AM33XX_PRM_DEVICE_MOD, AM33XX_PRM_RSTCTRL_OFFSET); @@ -386,7 +392,7 @@ static struct prm_ll_data am33xx_prm_ll_data = { .assert_hardreset = am33xx_prm_assert_hardreset, .deassert_hardreset = am33xx_prm_deassert_hardreset, .is_hardreset_asserted = am33xx_prm_is_hardreset_asserted, - .reset_system = am33xx_prm_global_warm_sw_reset, + .reset_system = am33xx_prm_global_sw_reset, }; int __init am33xx_prm_init(const struct omap_prcm_init_data *data) diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 25093c1e5b..6c555438dd 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -407,7 +407,7 @@ static bool omap44xx_prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx) } /** - * omap44xx_prm_clear_context_lost_flags_old - clear context loss flags + * omap44xx_prm_clear_context_loss_flags_old - clear context loss flags * @part: PRM partition ID (e.g., OMAP4430_PRM_PARTITION) * @inst: PRM instance offset (e.g., OMAP4430_PRM_MPU_INST) * @idx: CONTEXT register offset diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index fd896f2295..ee4588acda 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -67,6 +67,12 @@ struct omap_domain_base prm_base; u16 prm_features; /* + * Platforms that implement different reboot modes can store the requested + * mode here. + */ +enum reboot_mode prm_reboot_mode; + +/* * prm_ll_data: function pointers to SoC-specific implementations of * common PRM functions */ @@ -370,7 +376,7 @@ bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx) } /** - * prm_clear_context_lost_flags_old - clear context loss flags (old API) + * prm_clear_context_loss_flags_old - clear context loss flags (old API) * @part: PRM partition ID (e.g., OMAP4430_PRM_PARTITION) * @inst: PRM instance offset (e.g., OMAP4430_PRM_MPU_INST) * @idx: CONTEXT register offset @@ -497,6 +503,7 @@ int omap_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask) /** * omap_prm_vp_check_txdone - check voltage processor TX done status + * @vp_id: unique VP instance ID * * Checks if voltage processor transmission has been completed. * Returns non-zero if a transmission has completed, 0 otherwise. @@ -514,6 +521,7 @@ u32 omap_prm_vp_check_txdone(u8 vp_id) /** * omap_prm_vp_clear_txdone - clears voltage processor TX done status + * @vp_id: unique VP instance ID * * Clears the status bit for completed voltage processor transmission * returned by prm_vp_check_txdone. diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c index d4ea56a5f7..898e7e3329 100644 --- a/arch/arm/mach-omap2/wd_timer.c +++ b/arch/arm/mach-omap2/wd_timer.c @@ -57,7 +57,7 @@ int omap2_wd_timer_disable(struct omap_hwmod *oh) } /** - * omap2_wdtimer_reset - reset and disable the WDTIMER IP block + * omap2_wd_timer_reset - reset and disable the WDTIMER IP block * @oh: struct omap_hwmod * * * After the WDTIMER IP blocks are reset on OMAP2/3, we must also take @@ -71,6 +71,8 @@ int omap2_wd_timer_disable(struct omap_hwmod *oh) * during a normal merge window. omap_hwmod_softreset() should be * renamed to omap_hwmod_set_ocp_softreset(), and omap_hwmod_softreset() * should call the hwmod _ocp_softreset() code. + * + * Returns: %0 on success or -errno value on error. */ int omap2_wd_timer_reset(struct omap_hwmod *oh) { |