Commit be58fc7cc7d0f8a606c70fdef7e2450175cb2888
1 parent
d9d7210c
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
Showing
1 changed file
with
12 additions
and
8 deletions
hw/ppc405_uc.c
... | ... | @@ -75,7 +75,10 @@ ram_addr_t ppc405_set_bootinfo (CPUState *env, ppc4xx_bd_info_t *bd) |
75 | 75 | int i, n; |
76 | 76 | |
77 | 77 | /* We put the bd structure at the top of memory */ |
78 | - bdloc = bd->bi_memsize - sizeof(struct ppc4xx_bd_info_t); | |
78 | + if (bd->bi_memsize >= 0x01000000UL) | |
79 | + bdloc = 0x01000000UL - sizeof(struct ppc4xx_bd_info_t); | |
80 | + else | |
81 | + bdloc = bd->bi_memsize - sizeof(struct ppc4xx_bd_info_t); | |
79 | 82 | stl_raw(phys_ram_base + bdloc + 0x00, bd->bi_memstart); |
80 | 83 | stl_raw(phys_ram_base + bdloc + 0x04, bd->bi_memsize); |
81 | 84 | 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, |
952 | 955 | bcr = 0x000C0000; |
953 | 956 | break; |
954 | 957 | default: |
955 | - printf("%s: invalid RAM size " TARGET_FMT_ld "\n", __func__, ram_size); | |
958 | + printf("%s: invalid RAM size " TARGET_FMT_plx "\n", | |
959 | + __func__, ram_size); | |
956 | 960 | return 0x00000000; |
957 | 961 | } |
958 | 962 | bcr |= ram_base & 0xFF800000; |
... | ... | @@ -985,8 +989,8 @@ static void sdram_set_bcr (uint32_t *bcrp, uint32_t bcr, int enabled) |
985 | 989 | if (*bcrp & 0x00000001) { |
986 | 990 | /* Unmap RAM */ |
987 | 991 | #ifdef DEBUG_SDRAM |
988 | - printf("%s: unmap RAM area " ADDRX " " ADDRX "\n", __func__, | |
989 | - sdram_base(*bcrp), sdram_size(*bcrp)); | |
992 | + printf("%s: unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n", | |
993 | + __func__, sdram_base(*bcrp), sdram_size(*bcrp)); | |
990 | 994 | #endif |
991 | 995 | cpu_register_physical_memory(sdram_base(*bcrp), sdram_size(*bcrp), |
992 | 996 | IO_MEM_UNASSIGNED); |
... | ... | @@ -994,8 +998,8 @@ static void sdram_set_bcr (uint32_t *bcrp, uint32_t bcr, int enabled) |
994 | 998 | *bcrp = bcr & 0xFFDEE001; |
995 | 999 | if (enabled && (bcr & 0x00000001)) { |
996 | 1000 | #ifdef DEBUG_SDRAM |
997 | - printf("%s: Map RAM area " ADDRX " " ADDRX "\n", __func__, | |
998 | - sdram_base(bcr), sdram_size(bcr)); | |
1001 | + printf("%s: Map RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n", | |
1002 | + __func__, sdram_base(bcr), sdram_size(bcr)); | |
999 | 1003 | #endif |
1000 | 1004 | cpu_register_physical_memory(sdram_base(bcr), sdram_size(bcr), |
1001 | 1005 | sdram_base(bcr) | IO_MEM_RAM); |
... | ... | @@ -1023,8 +1027,8 @@ static void sdram_unmap_bcr (ppc4xx_sdram_t *sdram) |
1023 | 1027 | |
1024 | 1028 | for (i = 0; i < sdram->nbanks; i++) { |
1025 | 1029 | #ifdef DEBUG_SDRAM |
1026 | - printf("%s: Unmap RAM area " ADDRX " " ADDRX "\n", __func__, | |
1027 | - sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i])); | |
1030 | + printf("%s: Unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n", | |
1031 | + __func__, sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i])); | |
1028 | 1032 | #endif |
1029 | 1033 | cpu_register_physical_memory(sdram_base(sdram->bcr[i]), |
1030 | 1034 | sdram_size(sdram->bcr[i]), | ... | ... |