/*
 * milo/acer_pica_61.c
 */
#include <asm/pica.h>

typedef struct {
    char *name;
    unsigned int size; /* Size of a four SIMM bank in bytes */
} simm_type;

#define MB (1024*1024)
static simm_type simm_types[] = {
     { "4 * 256K*36 SIMM", 4 * MB },
     { "4 * 512K*36 SIMM", 8 * MB },
     { "4 * 1M*36 SIMM", 16 * MB },
     { "4 * 2M*36 SIMM", 32 * MB },
     { "4 * 4M*36 SIMM", 64 * MB },
     { "4 * 8M*36 SIMM", 128 * MB },
     { "(This should not happen)", 0 },
     { "No SIMM", 0 }
};

unsigned long acer_pica_61_mem(void)
{
    unsigned long ram;
    volatile dram_configuration *dc;

    dc = (dram_configuration *) PICA_DRAM_CONFIG;
    printf("RAM bank %s             : %s\r\n", (dc->mem_bus_width ? "A1" : "A "),
           simm_types[dc->bank1].name);
    printf("RAM bank %s             : %s\r\n", (dc->mem_bus_width ? "A2" : "B "),
           simm_types[dc->bank2].name);
    ram = simm_types[dc->bank1].size + simm_types[dc->bank2].size;
    printf("Total RAM detected      : %xMB\r\n", ram >> 20);

    return ram;
}
