Commit a2a444d6e097d0890a47e83ca6cf7dab35d043e2
1 parent
4b3686fa
PowerPC merge
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@862 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
15 additions
and
5 deletions
hw/ppc_prep.c
| ... | ... | @@ -937,18 +937,28 @@ void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device, |
| 937 | 937 | PPC_init_hw(/*env,*/ ram_size, KERNEL_LOAD_ADDR, ret, |
| 938 | 938 | KERNEL_STACK_ADDR, boot_device, initrd_filename); |
| 939 | 939 | } else { |
| 940 | + int bios_ram_offset; | |
| 941 | + | |
| 942 | +#define BIOS_START 0x00800000 | |
| 943 | + | |
| 940 | 944 | /* allocate ROM */ |
| 941 | - // snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); | |
| 942 | - snprintf(buf, sizeof(buf), "%s", BIOS_FILENAME); | |
| 943 | - printf("load BIOS at %p\n", phys_ram_base + 0x000f0000); | |
| 944 | - ret = load_image(buf, phys_ram_base + 0x000f0000); | |
| 945 | - if (ret != 0x10000) { | |
| 945 | + snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); | |
| 946 | + bios_ram_offset = ram_size + vga_ram_size; | |
| 947 | + printf("load BIOS at 0x%08x\n", BIOS_START); | |
| 948 | + ret = load_image(buf, phys_ram_base + bios_ram_offset); | |
| 949 | + if (ret != BIOS_SIZE) { | |
| 946 | 950 | fprintf(stderr, "qemu: could not load PPC bios '%s' (%d)\n%m\n", |
| 947 | 951 | buf, ret); |
| 948 | 952 | exit(1); |
| 949 | 953 | } |
| 954 | + global_env->nip = BIOS_START + BIOS_SIZE - 4; | |
| 955 | + cpu_register_physical_memory(BIOS_START, BIOS_SIZE, | |
| 956 | + IO_MEM_ROM | bios_ram_offset); | |
| 950 | 957 | } |
| 951 | 958 | |
| 959 | + /* Register CPU as a 74x/75x */ | |
| 960 | + cpu_ppc_register(cpu_single_env, 0x00080000); | |
| 961 | + /* Set time-base frequency to 100 Mhz */ | |
| 952 | 962 | cpu_ppc_tb_init(cpu_single_env, 100UL * 1000UL * 1000UL); |
| 953 | 963 | |
| 954 | 964 | /* init basic PC hardware */ | ... | ... |