]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Stop using immap_t for guts offset on 85xx
authorKumar Gala <galak@kernel.crashing.org>
Wed, 28 Nov 2007 05:25:02 +0000 (23:25 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 12 Dec 2007 04:34:19 +0000 (22:34 -0600)
In the future the offsets to various blocks may not be in same location.
Move to using CFG_MPC85xx_GUTS_ADDR as the base of the guts registers
instead of getting it via &immap->im_gur.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
20 files changed:
board/cds/mpc8541cds/mpc8541cds.c
board/cds/mpc8548cds/mpc8548cds.c
board/cds/mpc8555cds/mpc8555cds.c
board/freescale/mpc8544ds/mpc8544ds.c
board/mpc8540ads/mpc8540ads.c
board/mpc8540eval/mpc8540eval.c
board/mpc8560ads/mpc8560ads.c
board/mpc8568mds/mpc8568mds.c
board/pm854/pm854.c
board/pm856/pm856.c
board/sbc8560/sbc8560.c
board/stxgp3/stxgp3.c
board/stxssa/stxssa.c
board/tqm85xx/sdram.c
board/tqm85xx/tqm85xx.c
cpu/mpc85xx/pci.c
cpu/mpc85xx/qe_io.c
cpu/mpc85xx/spd_sdram.c
cpu/mpc85xx/speed.c
include/asm-ppc/immap_85xx.h

index 558ba9903ce1b13a3ce41c3307fab307f057eb5a..36b2fa1616f50b46a0658d0cabfb12d3b32080e1 100644 (file)
@@ -203,8 +203,7 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
        /* PCI slot in USER bits CSR[6:7] by convention. */
        uint pci_slot = get_pci_slot ();
@@ -250,7 +249,6 @@ long int
 initdram(int board_type)
 {
        long dram_size = 0;
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
@@ -263,7 +261,7 @@ initdram(int board_type)
                 *    Override DLL = 1, Course Adj = 1, Tap Select = 0
                 */
 
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
                gur->ddrdllcr = 0x81000000;
                asm("sync;isync;msync");
@@ -294,7 +292,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index 36d7e1ed487b0a1865d96e61bcd2330be1e1fa81..4f02f64db5bd845e758801035abb5edb65e5ba1c 100644 (file)
@@ -56,7 +56,7 @@ int board_early_init_f (void)
 int checkboard (void)
 {
        volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_local_ecm_t *ecm = &immap->im_local_ecm;
 
        /* PCI slot in USER bits CSR[6:7] by convention. */
@@ -96,7 +96,6 @@ long int
 initdram(int board_type)
 {
        long dram_size = 0;
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
@@ -109,7 +108,7 @@ initdram(int board_type)
                 *    Override DLL = 1, Course Adj = 1, Tap Select = 0
                 */
 
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
                gur->ddrdllcr = 0x81000000;
                asm("sync;isync;msync");
@@ -140,7 +139,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
@@ -330,8 +329,7 @@ int first_free_busno=0;
 void
 pci_init_board(void)
 {
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
        uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
 
index 8f1642187c150aa4812ddcd9ec4bbc83f94e8895..2f1b00e1ab4fb0ef3a45da6279799bc6541b6c16 100644 (file)
@@ -201,8 +201,7 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
        /* PCI slot in USER bits CSR[6:7] by convention. */
        uint pci_slot = get_pci_slot ();
@@ -248,7 +247,6 @@ long int
 initdram(int board_type)
 {
        long dram_size = 0;
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
@@ -261,7 +259,7 @@ initdram(int board_type)
                 *    Override DLL = 1, Course Adj = 1, Tap Select = 0
                 */
 
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
                gur->ddrdllcr = 0x81000000;
                asm("sync;isync;msync");
@@ -292,7 +290,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index 6f9864aefcc42061dba0e971dd49053c95aefc4f..e13be6388cb0ef0283adaecb281560344106bd47 100644 (file)
@@ -50,7 +50,7 @@ int board_early_init_f (void)
 int checkboard (void)
 {
        volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
        volatile ccsr_local_ecm_t *ecm = &immap->im_local_ecm;
 
@@ -146,8 +146,7 @@ int first_free_busno=0;
 void
 pci_init_board(void)
 {
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        uint devdisr = gur->devdisr;
        uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
        uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
index 914e51a7607014662fcabcdb72f9e1e4001a82d3..2db8b3256b8628e97a15911c4e47f12f91d758c9 100644 (file)
@@ -77,13 +77,12 @@ initdram(int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
 #if defined(CONFIG_DDR_DLL)
        {
-           volatile ccsr_gur_t *gur= &immap->im_gur;
+           volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
            uint temp_ddrdll = 0;
 
            /*
@@ -126,7 +125,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index 3b3c8ed26d0b86f2380665eb6c9528aed14d9808..52fe8cad0c2be709a9f1b7e6c49eb6839d09bbde 100644 (file)
@@ -75,7 +75,7 @@ long int initdram (int board_type)
        uint temp_lbcdll = 0;
 #endif
 #if !defined(CONFIG_RAM_AS_FLASH) || defined(CONFIG_DDR_DLL)
-       volatile ccsr_gur_t *gur= &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 #endif
 
 #if defined(CONFIG_DDR_DLL)
index eef524b45ea8b243a21257b741e6d4db11e599c7..4a30bce2a79d37e71b2623ad01455b580f43b997 100644 (file)
@@ -278,13 +278,12 @@ initdram(int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
 #if defined(CONFIG_DDR_DLL)
        {
-           volatile ccsr_gur_t *gur= &immap->im_gur;
+           volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
            uint temp_ddrdll = 0;
 
            /*
@@ -327,7 +326,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index 818ff138a99da2fe52e9a0dfdd7fdef470344349..2a68185bb9ec634679c597ccbacf339f368666d1 100644 (file)
@@ -133,7 +133,6 @@ long int
 initdram(int board_type)
 {
        long dram_size = 0;
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
@@ -146,7 +145,7 @@ initdram(int board_type)
                 *    Override DLL = 1, Course Adj = 1, Tap Select = 0
                 */
 
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
                gur->ddrdllcr = 0x81000000;
                asm("sync;isync;msync");
@@ -177,7 +176,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index 6ead1d06309af46aadbf08906d0b643e4b423bcf..15e948c5171751ae6d2ced3d1c4b5f03ec491b2a 100644 (file)
@@ -79,13 +79,12 @@ initdram(int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
 #if defined(CONFIG_DDR_DLL)
        {
-           volatile ccsr_gur_t *gur= &immap->im_gur;
+           volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
            int i,x;
 
            x = 10;
@@ -134,7 +133,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index a10075451e00ee905b51220172bc9a2123549aee..da4fd883365cfe49313992d79a8157948cd68091 100644 (file)
@@ -232,13 +232,12 @@ initdram(int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
        puts("Initializing\n");
 
 #if defined(CONFIG_DDR_DLL)
        {
-           volatile ccsr_gur_t *gur= &immap->im_gur;
+           volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
            int i,x;
 
            x = 10;
@@ -288,7 +287,7 @@ void
 local_bus_init(void)
 {
        volatile immap_t *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index e8b9929e77118b1432c3185bb0dad7e4168d2953..e02fb55678fad7604d8e792192e066ae475b634c 100644 (file)
@@ -264,7 +264,6 @@ long int initdram (int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 #if 0
 #if !defined(CONFIG_RAM_AS_FLASH)
        volatile ccsr_lbc_t *lbc= &immap->im_lbc;
@@ -273,7 +272,7 @@ long int initdram (int board_type)
 #endif
 #endif /* 0 */
 #if !defined(CONFIG_RAM_AS_FLASH) || defined(CONFIG_DDR_DLL)
-       volatile ccsr_gur_t *gur= &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 #endif
 #if defined(CONFIG_DDR_DLL)
        uint temp_ddrdll = 0;
index a58c043b629fa66fbce11300010ac90e4e9e2585..3b04949e025c3d1316f0d424253c6fc4b6f03f5c 100644 (file)
@@ -283,11 +283,10 @@ initdram (int board_type)
 {
        long dram_size = 0;
        extern long spd_sdram (void);
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
 
 #if defined(CONFIG_DDR_DLL)
        {
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
                uint temp_ddrdll = 0;
 
                /* Work around to stabilize DDR DLL */
index 9bacb98d86589a8f02b24c8474179a60f6278be9..253fb2b28f2b31f226c12ea5a53a1d2b1f6c87eb 100644 (file)
@@ -302,8 +302,7 @@ initdram (int board_type)
 
 #if defined(CONFIG_DDR_DLL)
        {
-               volatile immap_t *immap = (immap_t *)CFG_IMMR;
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
                uint temp_ddrdll = 0;
 
                /* Work around to stabilize DDR DLL */
index 9c1f0876872c6e50cdfff214fd727f994bef4c85..8ca50f54d936bb2771d38c4f24b6e06d51ce298a 100644 (file)
@@ -150,8 +150,7 @@ long int initdram (int board_type)
         * This DLL-Override only used on TQM8540 and TQM8560
         */
        {
-               volatile immap_t *immap = (immap_t *) CFG_IMMR;
-               volatile ccsr_gur_t *gur= &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
                int i,x;
 
                x = 10;
index 256c076c7ddf2ee26ea9a1ffdbffc2ae2f587ce1..c45676c0483df445e7d7602fd6d926fcce3f6bdb 100644 (file)
@@ -325,7 +325,7 @@ int misc_init_r (void)
 void local_bus_init (void)
 {
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile ccsr_lbc_t *lbc = &immap->im_lbc;
 
        uint clkdiv;
index db09e45fbcc3b5be8fac394d63be77067e9a0129..35e96d989632ffa9e781b52c027d7ff6e4bccbb7 100644 (file)
@@ -48,7 +48,7 @@ pci_mpc85xx_init(struct pci_controller *board_hose)
 #ifdef CONFIG_MPC85XX_PCI2
        volatile ccsr_pcix_t *pcix2 = &immap->im_pcix2;
 #endif
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        struct pci_controller * hose;
 
        pci_hose = board_hose;
index 8878bc53193fd10474c21250165beae09777e3a5..98075bbe54fcbe54f1617fd9eb0889f233bfccc2 100644 (file)
@@ -34,9 +34,9 @@ void qe_config_iopin(u8 port, u8 pin, int dir, int open_drain, int assign)
        u32                     pin_2bit_assign;
        u32                     pin_1bit_mask;
        u32                     tmp_val;
-       volatile immap_t        *im = (volatile immap_t *)CFG_IMMR;
+       volatile ccsr_gur_t     *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        volatile par_io_t       *par_io = (volatile par_io_t *)
-                                               &(im->im_gur.qe_par_io);
+                                               &(gur->qe_par_io);
 
        /* Caculate pin location and 2bit mask and dir */
        pin_2bit_mask = (u32)(0x3 << (NUM_OF_PINS-(pin%(NUM_OF_PINS/2)+1)*2));
index 5dc223a53e3ff3d82ea55a841c0b8eaceed1acf5..307ba3bf01366ff45f9fdcdc244a5cdb49110896 100644 (file)
@@ -309,7 +309,7 @@ spd_sdram(void)
        if ((SVR_VER(get_svr()) == SVR_8548_E) &&
                        (SVR_MJREV(get_svr()) == 1) &&
                        (spd.mem_type == SPD_MEMTYPE_DDR2)) {
-               volatile ccsr_gur_t *gur = &immap->im_gur;
+               volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
                gur->ddrioovcr = (0x80000000    /* Enable */
                                  | 0x10000000);/* VSEL to 1.8V */
        }
index 12359a2d64b0e7d40faae1d524c132aba2c2e9b2..5c35d4a50af08b4852bd65f9129d68255532eeeb 100644 (file)
@@ -35,8 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void get_sys_info (sys_info_t * sysInfo)
 {
-       volatile immap_t    *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
        uint plat_ratio,e500_ratio,half_freqSystemBus;
 
        plat_ratio = (gur->porpllsr) & 0x0000003e;
index 496fc72da34ff384befb943eeb5f4bbb8661b1fc..df53bd2d8001eeac0707136f65d5a0490afb825b 100644 (file)
@@ -1617,6 +1617,9 @@ typedef struct ccsr_gur {
        char    res15[61648];   /* 0xe0f30 to 0xefffff */
 } ccsr_gur_t;
 
+#define CFG_MPC85xx_GUTS_OFFSET        (0xE0000)
+#define CFG_MPC85xx_GUTS_ADDR  (CFG_IMMR + CFG_MPC85xx_GUTS_OFFSET)
+
 #define PORDEVSR_PCI   (0x00800000)    /* PCI Mode */
 
 typedef struct immap {
@@ -1634,8 +1637,6 @@ typedef struct immap {
        ccsr_tsec_t             im_tsec2;
        ccsr_pic_t              im_pic;
        ccsr_cpm_t              im_cpm;
-       ccsr_rio_t              im_rio;
-       ccsr_gur_t              im_gur;
 } immap_t;
 
 extern immap_t  *immr;