PPC: E500: Implement reboot controller
PATCH v3 1/1 PPC: E500: Implement reboot controller
When Linux reboots an e500 VM, it writes to a magic register in the "global-utilities" device indicated by the device tree. We were not emulating that device so far, renedering the VM reboot-less.
This patch implements that device with only the reboot functionality implemented and adds it to the device tree. With this patch applied, I can successfully reboot a -M mpc8544ds VM.
---
v1 -> v2:
- change name to mpc8544-guts
- rename file accordingly
- implement PVR and SVR registers
- add stub register defines
- add stderr printf when accessing unknown register
v2 -> v3:
- show subsystem in printfs
--- Makefile.target | 2 +- hw/mpc8544_guts.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++ hw/ppce500_mpc8544ds.c | 4 ++ pc-bios/mpc8544ds.dtb | Bin 12288 -> 2257 bytes pc-bios/mpc8544ds.dts | 6 ++ 5 files changed, 146 insertions(+), 1 deletions(-) create mode 100644 hw/mpc8544_guts.c
Makefile.target +1 -1
@@ -258,7 +258,7 @@ endif obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o obj-ppc-y += ppc440.o ppc440_bamboo.o # PowerPC E500 boards -obj-ppc-y += ppce500_mpc8544ds.o +obj-ppc-y += ppce500_mpc8544ds.o mpc8544_guts.o # PowerPC 440 Xilinx ML507 reference board. obj-ppc-y += virtex_ml507.o obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
hw/mpc8544_guts.c new file +135 -0
135 lines not on this page · raw message
hw/ppce500_mpc8544ds.c +4 -0
@@ -50,6 +50,7 @@#define MPC8544_PCI_REGS_SIZE 0x1000#define MPC8544_PCI_IO 0xE1000000#define MPC8544_PCI_IOLEN 0x10000 +#define MPC8544_UTIL_BASE (MPC8544_CCSRBAR_BASE + 0xe0000)struct boot_info {
@@ -270,6 +271,9 @@ static void mpc8544ds_init(ram_addr_t ram_size, serial_hds[0], 1, 1); } +/* General Utility device */ +sysbus_create_simple ("mpc8544-guts" ,MPC8544_UTIL_BASE ,NULL ); +/* PCI */ dev = sysbus_create_varargs("e500-pcihost", MPC8544_PCI_REGS_BASE, mpic[pci_irq_nrs[0]], mpic[pci_irq_nrs[1]],
pc-bios/mpc8544ds.dtb binary +0 -0
pc-bios/mpc8544ds.dts +6 -0
@@ -82,6 +82,12 @@ compatible = "chrp,open-pic"; device_type = "open-pic"; }; + + global-utilities@e0000 { //global utilities block + compatible = "fsl,mpc8544-guts"; + reg = <0xe0000 0x1000>; + fsl,has-rstcr; + }; }; pci0: pci@e0008000 {
Signature · 1 line
1.6.0.2
Am 02.06.2011 um 20:58 schrieb Alexander Graf:
Quoted 3 lines
When Linux reboots an e500 VM, it writes to a magic register in the "global-utilities" device indicated by the device tree. We were not emulating that device so far, renedering the VM reboot-less.
rendering
Quoted 20 lines
This patch implements that device with only the reboot functionality implemented and adds it to the device tree. With this patch applied, I can successfully reboot a -M mpc8544ds VM.
Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- change name to mpc8544-guts
- rename file accordingly
- implement PVR and SVR registers
- add stub register defines
- add stderr printf when accessing unknown registerv2 -> v3:
- show subsystem in printfs
---
[...]
Quoted 5 lines
hw/mpc8544_guts.c new file +0
-0
[...]
hw/mpc8544_guts.c line 135
Quoted 5 lines
hw/mpc8544_guts.c new file +5
-0+static void mpc8544_pci_register (void ) +{ +sysbus_register_withprop (&mpc8544_guts_info); +} +device_init (mpc8544_pci_register);
Is the naming mpc8544_pci_register() intentional? I would find mpc8544_guts_register() more intuitive since the file is called mpc8544_guts.c.
Otherwise looks okay to me.
Andreas
Quoted 7 lines · Andreas Färber
Am 02.06.2011 um 20:58 schrieb Alexander Graf:
Quoted 3 lines
When Linux reboots an e500 VM, it writes to a magic register in the "global-utilities" device indicated by the device tree. We were not emulating that device so far, renedering the VM reboot-less.
rendering
Oops :)
Quoted 28 lines
Quoted 21 lines
This patch implements that device with only the reboot functionality implemented and adds it to the device tree. With this patch applied, I can successfully reboot a -M mpc8544ds VM.
Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- change name to mpc8544-guts
- rename file accordingly
- implement PVR and SVR registers
- add stub register defines
- add stderr printf when accessing unknown registerv2 -> v3:
- show subsystem in printfs
---[...]
Quoted 5 lines
hw/mpc8544_guts.c new file +0
-0[...]
Quoted 8 lines
hw/mpc8544_guts.c line 135
Quoted 5 lines
hw/mpc8544_guts.c new file +5
-0+static void mpc8544_pci_register (void ) +{ +sysbus_register_withprop (&mpc8544_guts_info); +} +device_init (mpc8544_pci_register);Is the naming
mpc8544_pci_register()intentional? I would findmpc8544_guts_register()more intuitive since the file is calledmpc8544_guts.c.
Eh - no :). That's me being very bad on copy&paste ;)
Alex