]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: Move mmr_unlock to a common location
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 5 Aug 2020 17:14:17 +0000 (22:44 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 11 Aug 2020 15:04:46 +0000 (20:34 +0530)
mmr_unlock api is common for all k3 devices. Move it to a common
location.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
arch/arm/mach-k3/am6_init.c
arch/arm/mach-k3/common.c
arch/arm/mach-k3/common.h
arch/arm/mach-k3/j721e_init.c

index 9cb30860145d64236c6e7c29b91d0a88701a2f72..e66d1c1fe14af6ebb74953b55d5b4582fc92bc32 100644 (file)
@@ -46,16 +46,6 @@ struct fwl_data main_cbass_fwls[] = {
 #endif
 #endif
 
-static void mmr_unlock(u32 base, u32 partition)
-{
-       /* Translate the base address */
-       phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-       /* Unlock the requested partition if locked using two-step sequence */
-       writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-       writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
 static void ctrl_mmr_unlock(void)
 {
        /* Unlock all WKUP_CTRL_MMR0 module registers */
index 4335f2877b8d8c17030a3f77cc6a323888378093..178dc210c357333a1b310aaeafeaebca63cd1bd5 100644 (file)
@@ -62,6 +62,16 @@ void k3_sysfw_print_ver(void)
               ti_sci->version.firmware_revision, fw_desc);
 }
 
+void mmr_unlock(phys_addr_t base, u32 partition)
+{
+       /* Translate the base address */
+       phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
+
+       /* Unlock the requested partition if locked using two-step sequence */
+       writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
+       writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
+}
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_K3_EARLY_CONS
index ba344c5bc9dd72c4e6ab2d100a40b432c250d9ab..44cf94a17461c7fb390c11ec9318553e319c1c9d 100644 (file)
@@ -22,3 +22,4 @@ void start_non_linux_remote_cores(void);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
 void k3_sysfw_print_ver(void);
 void spl_enable_dcache(void);
+void mmr_unlock(phys_addr_t base, u32 partition);
index 5ec62a92f82c179ddc26fadf81d97148634849f8..2010cab1d1da865f8b53c6c12ce486beb175a2de 100644 (file)
@@ -64,16 +64,6 @@ struct fwl_data cbass_hc_cfg0_fwls[] = {
 #endif
 #endif
 
-static void mmr_unlock(u32 base, u32 partition)
-{
-       /* Translate the base address */
-       phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-       /* Unlock the requested partition if locked using two-step sequence */
-       writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-       writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
 static void ctrl_mmr_unlock(void)
 {
        /* Unlock all WKUP_CTRL_MMR0 module registers */