j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * QEMU PowerPC 405 shared definitions |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 3 | * |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 4 | * Copyright (c) 2007 Jocelyn Mayer |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 5 | * |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to deal |
| 8 | * in the Software without restriction, including without limitation the rights |
| 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | * copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in |
| 14 | * all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | * THE SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #if !defined(PPC_405_H) |
| 26 | #define PPC_405_H |
| 27 | |
Paolo Bonzini | 0d09e41 | 2013-02-05 17:06:20 +0100 | [diff] [blame] | 28 | #include "hw/ppc/ppc4xx.h" |
j_mayer | 008ff9d | 2007-10-07 14:21:26 +0000 | [diff] [blame] | 29 | |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 30 | /* Bootinfo as set-up by u-boot */ |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 31 | typedef struct ppc4xx_bd_info_t ppc4xx_bd_info_t; |
| 32 | struct ppc4xx_bd_info_t { |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 33 | uint32_t bi_memstart; |
| 34 | uint32_t bi_memsize; |
| 35 | uint32_t bi_flashstart; |
| 36 | uint32_t bi_flashsize; |
| 37 | uint32_t bi_flashoffset; /* 0x10 */ |
| 38 | uint32_t bi_sramstart; |
| 39 | uint32_t bi_sramsize; |
| 40 | uint32_t bi_bootflags; |
| 41 | uint32_t bi_ipaddr; /* 0x20 */ |
| 42 | uint8_t bi_enetaddr[6]; |
| 43 | uint16_t bi_ethspeed; |
| 44 | uint32_t bi_intfreq; |
| 45 | uint32_t bi_busfreq; /* 0x30 */ |
| 46 | uint32_t bi_baudrate; |
| 47 | uint8_t bi_s_version[4]; |
| 48 | uint8_t bi_r_version[32]; |
| 49 | uint32_t bi_procfreq; |
| 50 | uint32_t bi_plb_busfreq; |
| 51 | uint32_t bi_pci_busfreq; |
| 52 | uint8_t bi_pci_enetaddr[6]; |
| 53 | uint32_t bi_pci_enetaddr2[6]; |
| 54 | uint32_t bi_opbfreq; |
| 55 | uint32_t bi_iic_fast[2]; |
| 56 | }; |
| 57 | |
| 58 | /* PowerPC 405 core */ |
Andreas Färber | e2684c0 | 2012-03-14 01:38:23 +0100 | [diff] [blame] | 59 | ram_addr_t ppc405_set_bootinfo (CPUPPCState *env, ppc4xx_bd_info_t *bd, |
j_mayer | b8d3f5d | 2007-09-26 23:55:31 +0000 | [diff] [blame] | 60 | uint32_t flags); |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 61 | |
Andreas Färber | e2684c0 | 2012-03-14 01:38:23 +0100 | [diff] [blame] | 62 | CPUPPCState *ppc405cr_init(MemoryRegion *address_space_mem, |
Richard Henderson | 52ce55a | 2011-08-11 16:07:17 -0700 | [diff] [blame] | 63 | MemoryRegion ram_memories[4], |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 64 | hwaddr ram_bases[4], |
| 65 | hwaddr ram_sizes[4], |
Richard Henderson | 52ce55a | 2011-08-11 16:07:17 -0700 | [diff] [blame] | 66 | uint32_t sysclk, qemu_irq **picp, |
| 67 | int do_init); |
Andreas Färber | e2684c0 | 2012-03-14 01:38:23 +0100 | [diff] [blame] | 68 | CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem, |
Richard Henderson | 52ce55a | 2011-08-11 16:07:17 -0700 | [diff] [blame] | 69 | MemoryRegion ram_memories[2], |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 70 | hwaddr ram_bases[2], |
| 71 | hwaddr ram_sizes[2], |
Richard Henderson | 52ce55a | 2011-08-11 16:07:17 -0700 | [diff] [blame] | 72 | uint32_t sysclk, qemu_irq **picp, |
| 73 | int do_init); |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 74 | /* IBM STBxxx microcontrollers */ |
Andreas Färber | e2684c0 | 2012-03-14 01:38:23 +0100 | [diff] [blame] | 75 | CPUPPCState *ppc_stb025_init (MemoryRegion ram_memories[2], |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 76 | hwaddr ram_bases[2], |
| 77 | hwaddr ram_sizes[2], |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 78 | uint32_t sysclk, qemu_irq **picp, |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 79 | ram_addr_t *offsetp); |
j_mayer | 04f2079 | 2007-04-17 02:50:56 +0000 | [diff] [blame] | 80 | |
| 81 | #endif /* !defined(PPC_405_H) */ |