This is a small set of fixes that came out of my current queue of SPARC64 patches.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (3): vga.fs: do not attempt to map MMIO registers more than once pci: always use devfn 0 for PCI host bridge ranges SPARC64: fix up PCI-EBus interrupt map and ino for PS/2 keyboard device
drivers/pci.c | 21 +++++++++++++++------ drivers/vga.fs | 4 +++- 2 files changed, 18 insertions(+), 7 deletions(-)
The FreeBSD PPC bootloader attempts to reset the console causing an error because the MMIO registers are already mapped. Add a check to ensure that we only map them once.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/vga.fs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/vga.fs b/drivers/vga.fs index d39b062..080edf2 100644 --- a/drivers/vga.fs +++ b/drivers/vga.fs @@ -233,7 +233,9 @@ headerless \
: qemu-vga-driver-install ( -- ) - map-mmio vbe-init + mmio-addr -1 = if + map-mmio vbe-init + then fb-addr -1 = if map-fb fb-addr to frame-buffer-adr default-font set-font
Always use devfn 0 for PCI host bridge ranges, regardless of the devfn of the bridge itself. This generates a PCI host bridge ranges property matching that of real hardware for PPC machines.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index bd8b87e..b533898 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -488,26 +488,26 @@ static void pci_host_set_ranges(const pci_config_t *config) bridges except for SPARC, particularly as it causes Darwin/OS X to incorrectly calculated PCI memory space ranges on PPC. */ ncells += pci_encode_phys_addr(props + ncells, 0, CONFIGURATION_SPACE, - config->dev, 0, 0); + 0, 0, 0); ncells += host_encode_phys_addr(props + ncells, arch->cfg_addr); ncells += pci_encode_size(props + ncells, arch->cfg_len); #endif
if (arch->io_base) { ncells += pci_encode_phys_addr(props + ncells, 0, IO_SPACE, - config->dev, 0, 0); + 0, 0, 0); ncells += host_encode_phys_addr(props + ncells, arch->io_base); ncells += pci_encode_size(props + ncells, arch->io_len); } if (arch->rbase) { ncells += pci_encode_phys_addr(props + ncells, 0, MEMORY_SPACE_32, - config->dev, 0, 0); + 0, 0, 0); ncells += host_encode_phys_addr(props + ncells, arch->rbase); ncells += pci_encode_size(props + ncells, arch->rlen); } if (arch->pci_mem_base) { ncells += pci_encode_phys_addr(props + ncells, 0, MEMORY_SPACE_32, - config->dev, 0, arch->pci_mem_base); + 0, 0, arch->pci_mem_base); ncells += host_encode_phys_addr(props + ncells, arch->host_pci_base + arch->pci_mem_base); ncells += pci_encode_size(props + ncells, arch->mem_len);
This allows the PS/2 keyboard device to be detected and used under *BSD for SPARC64.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index b533898..e803ab2 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -866,12 +866,21 @@ int ebus_config_cb(const pci_config_t *config) ucell virt; phys_addr_t io_phys_base = 0;
+ /* Serial */ props[0] = 0x14; props[1] = 0x3f8; props[2] = 1; props[3] = find_dev("/"); props[4] = 0x2b; - set_property(dev, "interrupt-map", (char *)props, 5 * sizeof(props[0])); + + /* PS2 keyboard */ + props[5] = 0x14; + props[6] = 0x60; + props[7] = 1; + props[8] = find_dev("/"); + props[9] = 0x29; + + set_property(dev, "interrupt-map", (char *)props, 10 * sizeof(props[0]));
props[0] = 0x000001ff; props[1] = 0xffffffff; @@ -940,7 +949,7 @@ int ebus_config_cb(const pci_config_t *config) ob_pc_serial_init(config->path, "su", (PCI_BASE_ADDR_1 | 0ULL) << 32, 0x3f8ULL, 0); #endif #ifdef CONFIG_DRIVER_PC_KBD - ob_pc_kbd_init(config->path, "kb_ps2", (PCI_BASE_ADDR_1 | 0ULL) << 32, 0x60ULL, 0); + ob_pc_kbd_init(config->path, "kb_ps2", (PCI_BASE_ADDR_1 | 0ULL) << 32, 0x60ULL, 1); #endif #endif return 0;
On 08/07/17 20:19, Mark Cave-Ayland wrote:
This is a small set of fixes that came out of my current queue of SPARC64 patches.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (3): vga.fs: do not attempt to map MMIO registers more than once pci: always use devfn 0 for PCI host bridge ranges SPARC64: fix up PCI-EBus interrupt map and ino for PS/2 keyboard device
drivers/pci.c | 21 +++++++++++++++------ drivers/vga.fs | 4 +++- 2 files changed, 18 insertions(+), 7 deletions(-)
Applied to master.
ATB,
Mark.