/*
 *               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 {
    u32 napaSize;
    u32 napaSimSize;
    u32 napaSecureBoundary;
    u32 napaArenaLo;
    u32 napaArenaHi;
    u32 pad0;
    u32 ddrSize;
    u32 ddrSimSize;
    u32 ddrSecureBoundary;
    u32 ddrArenaLo;
    u32 ddrArenaHi;
    u32 pad1;
    u32 ipcArenaLo;
    u32 ipcArenaHi;
    u32 hollywoodRev;
    u32 pad2;
    u32 iosVersion;
    u32 iosBuild;
} 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
#define LOMEM_HOLLYWOOD_REV                   0x00000001

#ifdef DDR_SIZE_128M
#define LOMEM_DDR_SIZE                        0x08000000
#define LOMEM_DDR_SIMSIZE                     0x08000000
#define LOMEM_DDR_SECURE_BOUNDARY             0x97800000
#define LOMEM_DDR_SECURE_BOUNDARY_PHYS        0x17800000
#define LOMEM_DDR_ARENALO                     0x90000800
#define LOMEM_DDR_ARENAHI                     0x977e0000
#define LOMEM_IPC_ARENALO                     0x977e0000
#define LOMEM_IPC_ARENAHI                     0x97800000
#endif /* DDR_SIZE_128M */

#ifdef DDR_SIZE_64M
#define LOMEM_DDR_SIZE                        0x04000000
#define LOMEM_DDR_SIMSIZE                     0x04000000
#define LOMEM_DDR_SECURE_BOUNDARY             0x93800000
#define LOMEM_DDR_SECURE_BOUNDARY_PHYS        0x13800000
#define LOMEM_DDR_ARENALO                     0x90000800
#define LOMEM_DDR_ARENAHI                     0x937e0000
#define LOMEM_IPC_ARENALO                     0x937e0000
#define LOMEM_IPC_ARENAHI                     0x93800000
#endif /* DDR_SIZE_64M */

#endif /* __RVL_LOMEM_H__ */
