From: Mark A. Greer <[email protected]>

On the da830, the jtag id register used to determine
the cpu type is in the config register space.  The
registers in that space can be protected from I/O.
To unlock that space, two "kick registers" need to
be written to with certain values and in the correct
order.

This can only be done in davinci_common_init()
between the mapping of the I/O registers and
the reading the jtag id register.  To get inside
that window, add an 'early_init()' hook to
davinci_soc_init and call it from the proper
point inside davinci_common_init().  The code
to do the actual unlock is already provided
by da830_unlock_cfg_regs() in da830.c.

Signed-off-by: Mark A. Greer <[email protected]>
---
 arch/arm/mach-davinci/board-da830-evm.c     |    1 +
 arch/arm/mach-davinci/common.c              |    3 +++
 arch/arm/mach-davinci/include/mach/common.h |    1 +
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c 
b/arch/arm/mach-davinci/board-da830-evm.c
index a9fcc1a..e0dd12d 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -115,6 +115,7 @@ static void __init da830_evm_map_io(void)
        struct davinci_soc_info *soc_info;
 
        soc_info = da830_get_soc_info();
+       soc_info->early_init = da830_unlock_cfg_regs;
        davinci_common_init(soc_info);
 }
 
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 902d677..df57273 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -64,6 +64,9 @@ int __init davinci_common_init(struct davinci_soc_info 
*soc_info)
        local_flush_tlb_all();
        flush_cache_all();
 
+       if (soc_info->early_init)
+               soc_info->early_init();
+
        /*
         * We want to check CPU revision early for cpu_is_xxxx() macros.
         * IO space mapping must be initialized before we can do that.
diff --git a/arch/arm/mach-davinci/include/mach/common.h 
b/arch/arm/mach-davinci/include/mach/common.h
index e56988b..5b54aa4 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -39,6 +39,7 @@ struct davinci_timer_info {
 struct davinci_soc_info {
        struct map_desc                 *io_desc;
        unsigned long                   io_desc_num;
+       void                            (*early_init)(void);
        u32                             cpu_id;
        u32                             jtag_id;
        void __iomem                    *jtag_id_base;
-- 
1.6.0.3


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to