/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

/* Derived from Nintendo's description of LoMem initialization for
 * Revolution.
 */

#ifndef __RVL_LOMEM_H__
#define __RVL_LOMEM_H__
/* Napa is at 0x0. Addresses for LoMem */
#define RVL_LOMEM_BASE 0x3100

#define NAPA_SIZE_ALTERNATE_ADDR     0x00000028
#define NAPA_SIM_SIZE_ALTERNATE_ADDR 0x000000f0
#define NAPA_ARENALO_ALTERNATE_ADDR  0x00000030
#define NAPA_ARENAHI_ALTERNATE_ADDR  0x00000034

#define NAPA_LOMEM_CLEAR_START 0x0
#define NAPA_LOMEM_CLEAR_SIZE 0x3fff

typedef struct {                    /* Address */
    u32 napaSize;                   /* 0x0000_3100 */
    u32 napaSimSize;                /* 0x0000_3104 */
    u32 napaSecureBoundary;         /* 0x0000_3108 */
    u32 napaArenaLo;                /* 0x0000_310c */
    u32 napaArenaHi;                /* 0x0000_3110 */
    u32 pad0;                       /* 0x0000_3114 */
    u32 ddrSize;                    /* 0x0000_3118 */
    u32 ddrSimSize;                 /* 0x0000_311c */
    u32 ddrSecureBoundary;          /* 0x0000_3120 */
    u32 ddrArenaLo;                 /* 0x0000_3124 */
    u32 ddrArenaHi;                 /* 0x0000_3128 */
    u32 pad1;                       /* 0x0000_312c */
    u32 ipcArenaLo;                 /* 0x0000_3130 */
    u32 ipcArenaHi;                 /* 0x0000_3134 */
    u32 hollywoodRev;               /* 0x0000_3138 */
    u32 pad2;                       /* 0x0000_313c */
    u32 iosVersion;                 /* 0x0000_3140 */
    u32 iosBuild;                   /* 0x0000_3144 */
    u32 diBufferLo;                 /* 0x0000_3148 */
    u32 diBufferHi;                 /* 0x0000_314c */
    u32 pad3;                       /* 0x0000_3150 */
    u32 pad4;                       /* 0x0000_3154 */
    u32 ddrVendorId;                /* 0x0000_3158 
                                     *  byte 0 = vid0 
                                     *  byte 1 = vid1
                                     */
    u32 pad5;                       /* 0x0000_315c */
    u32 syncAHBPI;                  /* 0x0000_3160 */
} OSLoMem;


/* Values written into LoMem by IOP for PPC boot */
/* This is done in __initLoMem, file init_lomem.c */
#define LOMEM_NAPA_SIZE                       0x01800000
#define LOMEM_NAPA_SIM_SIZE                   0x01800000 
#define LOMEM_NAPA_SECURE_BOUNDARY            0x81800000
#define LOMEM_NAPA_ARENA_LO                   0x00000000
#define LOMEM_NAPA_ARENA_HI                   0x81800000

#ifdef DDR_SIZE_128M
#define LOMEM_DDR_SIZE                        0x08000000
#define LOMEM_DDR_SIMSIZE                     0x08000000
#define LOMEM_DDR_SECURE_BOUNDARY             0x97400000
#define LOMEM_DDR_SECURE_BOUNDARY_PHYS        0x17400000
#define LOMEM_DDR_ARENALO                     0x90000800
#define LOMEM_DDR_ARENAHI                     0x973e0000
#define LOMEM_IPC_ARENALO                     0x973e0000
#define LOMEM_IPC_ARENAHI                     0x97400000
#endif /* DDR_SIZE_128M */

#ifdef DDR_SIZE_64M
#define LOMEM_DDR_SIZE                        0x04000000
#define LOMEM_DDR_SIMSIZE                     0x04000000
#define LOMEM_DDR_SECURE_BOUNDARY             0x93400000
#define LOMEM_DDR_SECURE_BOUNDARY_PHYS        0x13400000
#define LOMEM_DDR_ARENALO                     0x90000800
#define LOMEM_DDR_ARENAHI                     0x933e0000
#define LOMEM_IPC_ARENALO                     0x933e0000
#define LOMEM_IPC_ARENAHI                     0x93400000
#endif /* DDR_SIZE_64M */

#define LOMEM_AHBPI_ENABLED  0x0
#define LOMEM_AHBPI_DISABLED 0xdeadbeef
#endif /* __RVL_LOMEM_H__ */
