Always keep the bootinfo structure in the first 16 MB,

as suggested by Andrew May.
Fix compilation warnings introduced by variables types changes.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3183 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
j_mayer 2007-09-18 21:47:18 +00:00
parent d9d7210c7d
commit be58fc7cc7
1 changed files with 12 additions and 8 deletions

View File

@ -75,7 +75,10 @@ ram_addr_t ppc405_set_bootinfo (CPUState *env, ppc4xx_bd_info_t *bd)
int i, n; int i, n;
/* We put the bd structure at the top of memory */ /* We put the bd structure at the top of memory */
bdloc = bd->bi_memsize - sizeof(struct ppc4xx_bd_info_t); if (bd->bi_memsize >= 0x01000000UL)
bdloc = 0x01000000UL - sizeof(struct ppc4xx_bd_info_t);
else
bdloc = bd->bi_memsize - sizeof(struct ppc4xx_bd_info_t);
stl_raw(phys_ram_base + bdloc + 0x00, bd->bi_memstart); stl_raw(phys_ram_base + bdloc + 0x00, bd->bi_memstart);
stl_raw(phys_ram_base + bdloc + 0x04, bd->bi_memsize); stl_raw(phys_ram_base + bdloc + 0x04, bd->bi_memsize);
stl_raw(phys_ram_base + bdloc + 0x08, bd->bi_flashstart); stl_raw(phys_ram_base + bdloc + 0x08, bd->bi_flashstart);
@ -952,7 +955,8 @@ static uint32_t sdram_bcr (target_phys_addr_t ram_base,
bcr = 0x000C0000; bcr = 0x000C0000;
break; break;
default: default:
printf("%s: invalid RAM size " TARGET_FMT_ld "\n", __func__, ram_size); printf("%s: invalid RAM size " TARGET_FMT_plx "\n",
__func__, ram_size);
return 0x00000000; return 0x00000000;
} }
bcr |= ram_base & 0xFF800000; bcr |= ram_base & 0xFF800000;
@ -985,8 +989,8 @@ static void sdram_set_bcr (uint32_t *bcrp, uint32_t bcr, int enabled)
if (*bcrp & 0x00000001) { if (*bcrp & 0x00000001) {
/* Unmap RAM */ /* Unmap RAM */
#ifdef DEBUG_SDRAM #ifdef DEBUG_SDRAM
printf("%s: unmap RAM area " ADDRX " " ADDRX "\n", __func__, printf("%s: unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",
sdram_base(*bcrp), sdram_size(*bcrp)); __func__, sdram_base(*bcrp), sdram_size(*bcrp));
#endif #endif
cpu_register_physical_memory(sdram_base(*bcrp), sdram_size(*bcrp), cpu_register_physical_memory(sdram_base(*bcrp), sdram_size(*bcrp),
IO_MEM_UNASSIGNED); IO_MEM_UNASSIGNED);
@ -994,8 +998,8 @@ static void sdram_set_bcr (uint32_t *bcrp, uint32_t bcr, int enabled)
*bcrp = bcr & 0xFFDEE001; *bcrp = bcr & 0xFFDEE001;
if (enabled && (bcr & 0x00000001)) { if (enabled && (bcr & 0x00000001)) {
#ifdef DEBUG_SDRAM #ifdef DEBUG_SDRAM
printf("%s: Map RAM area " ADDRX " " ADDRX "\n", __func__, printf("%s: Map RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",
sdram_base(bcr), sdram_size(bcr)); __func__, sdram_base(bcr), sdram_size(bcr));
#endif #endif
cpu_register_physical_memory(sdram_base(bcr), sdram_size(bcr), cpu_register_physical_memory(sdram_base(bcr), sdram_size(bcr),
sdram_base(bcr) | IO_MEM_RAM); sdram_base(bcr) | IO_MEM_RAM);
@ -1023,8 +1027,8 @@ static void sdram_unmap_bcr (ppc4xx_sdram_t *sdram)
for (i = 0; i < sdram->nbanks; i++) { for (i = 0; i < sdram->nbanks; i++) {
#ifdef DEBUG_SDRAM #ifdef DEBUG_SDRAM
printf("%s: Unmap RAM area " ADDRX " " ADDRX "\n", __func__, printf("%s: Unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",
sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i])); __func__, sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i]));
#endif #endif
cpu_register_physical_memory(sdram_base(sdram->bcr[i]), cpu_register_physical_memory(sdram_base(sdram->bcr[i]),
sdram_size(sdram->bcr[i]), sdram_size(sdram->bcr[i]),