Here are a couple of fixes that correct the display colors in the Solaris
console login screen. It seems that the Solaris drivers assume the
foreground and background colors are in different palette entries to those
currently used by OpenBIOS causing the console to appear invisible as
white text on a white background.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
v2:
- Reword commit message for first patch as suggested by Tarl
Mark Cave-Ayland (2):
display.fs: fix off-by-one errors in color palette initialisation
display.fs: fix palette entries for foreground and background colors
forth/device/display.fs | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
--
1.7.10.4
obp_dumb_mmap() needs to call ofmem_map() rather than the low-level
ofmem_arch_map_pages() function otherwise the specified area is mapped directly
on the CPU without being recorded in the relevant memory node properties.
This fixes Solaris 2.6 which uses obp_dumb_mmap() to map the kernel msgbuf and
would otherwise trap on boot as the mapping was lost once the kernel had taken
over memory management from OpenBIOS.
While we're here, add a missing DPRINTF() to obp_dumb_mmap() and provide the
corresponding obp_dumb_munmap() implementation.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
---
arch/sparc32/lib.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/sparc32/lib.c b/arch/sparc32/lib.c
index d27b604..a53a396 100644
--- a/arch/sparc32/lib.c
+++ b/arch/sparc32/lib.c
@@ -196,15 +196,25 @@ char *obp_dumb_mmap(char *va, int which_io, unsigned int pa,
unsigned int size)
{
uint64_t mpa = ((uint64_t)which_io << 32) | (uint64_t)pa;
+ ucell virt;
+
+ DPRINTF("obp_dumb_mmap: virta 0x%x, phys 0x%x, size %d\n", (unsigned int)va, pa, size);
+
+ /* Claim virtual memory */
+ virt = ofmem_claim_virt(pointer2cell(va), size, 0);
- ofmem_arch_map_pages(mpa, (unsigned long)va, size, ofmem_arch_default_translation_mode(mpa));
- return va;
+ /* Map memory */
+ ofmem_map(mpa, virt, size, ofmem_arch_default_translation_mode(mpa));
+
+ return cell2pointer(virt);
}
-void obp_dumb_munmap(__attribute__((unused)) char *va,
- __attribute__((unused)) unsigned int size)
+void obp_dumb_munmap(char *va, unsigned int size)
{
DPRINTF("obp_dumb_munmap: virta 0x%x, sz %d\n", (unsigned int)va, size);
+
+ ofmem_unmap(pointer2cell(va), size);
+ ofmem_release_virt(pointer2cell(va), size);
}
char *obp_memalloc(char *va, unsigned int size, unsigned int align)
--
1.7.10.4
Currently all PCI devices except display devices are initialised with
simple open and close words that are effectively a no-op, but enable
the device to be accessed.
Unfortunately this means that if devices have custom open and close words
then the existing ones are overwritten causing OpenBIOS to emit warnings
such as "open isn't unique" on the console.
Resolve this by defaulting all PCI devices to the empty PCI node template
ob_pci_empty_node and then adding the simple open and close words after
the device has been initialised if they do not already exist.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
---
drivers/pci.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c
index d698364..c7b2bd2 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -49,7 +49,7 @@
/* DECLARE data structures for the nodes. */
DECLARE_UNNAMED_NODE( ob_pci_bus_node, INSTALL_OPEN, 2*sizeof(int) );
-DECLARE_UNNAMED_NODE( ob_pci_simple_node, INSTALL_OPEN, 2*sizeof(int) );
+DECLARE_UNNAMED_NODE( ob_pci_simple_node, 0, 2*sizeof(int) );
DECLARE_UNNAMED_NODE( ob_pci_empty_node, 0, 2*sizeof(int) );
const pci_arch_t *arch;
@@ -399,7 +399,6 @@ NODE_METHODS(ob_pci_bus_node) = {
};
NODE_METHODS(ob_pci_simple_node) = {
- { NULL, ob_pci_initialize },
{ "open", ob_pci_open },
{ "close", ob_pci_close },
};
@@ -1418,11 +1417,8 @@ static void ob_configure_pci_device(const char* parent_path,
REGISTER_NAMED_NODE_PHANDLE(ob_pci_bus_node, config.path, phandle);
}
break;
- case PCI_CLASS_DISPLAY:
- REGISTER_NAMED_NODE_PHANDLE(ob_pci_empty_node, config.path, phandle);
- break;
default:
- REGISTER_NAMED_NODE_PHANDLE(ob_pci_simple_node, config.path, phandle);
+ REGISTER_NAMED_NODE_PHANDLE(ob_pci_empty_node, config.path, phandle);
break;
}
@@ -1460,6 +1456,11 @@ static void ob_configure_pci_device(const char* parent_path,
pci_dev->config_cb(&config);
}
+ /* if devices haven't supplied open/close words then supply them with simple defaults */
+ if (!find_package_method("open", phandle) && !find_package_method("close", phandle)) {
+ REGISTER_NODE_METHODS(ob_pci_simple_node, config.path);
+ }
+
/* device is configured so we may move it out of scope */
device_end();
--
1.7.10.4
This patchset is part of the ongoing work to add virtio support to
OpenBIOS, yet self-contained enough to be spun out as a separate
patchset.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
v2:
- Add comment explaining BE access for file API
- Add mising byte swap macros to fw_cfg_find_file()
Mark Cave-Ayland (3):
fw_cfg: split fw_cfg_read() into fw_cfg_read() and
fw_cfg_read_bytes()
fw_cfg: add fw_cfg_find_file() and fw_cfg_read_file() functions
fw_cfg: implement fw-cfg-read-file Forth word
drivers/fw_cfg.c | 89 +++++++++++++++++++++++++++++++++++++++---
include/arch/common/fw_cfg.h | 16 ++++++++
libopenbios/init.c | 7 +++-
3 files changed, 105 insertions(+), 7 deletions(-)
--
1.7.10.4
Here are a couple of fixes that correct the display colors in the Solaris
console login screen. It seems that the Solaris drivers assume the
foreground and background colors are in different palette entries to those
currently used by OpenBIOS causing the console to appear invisible as
white text on a white background.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Mark Cave-Ayland (2):
display.fs: fix off-by-one errors in color palette initialisation
display.fs: fix palette entries for foreground and background colors
forth/device/display.fs | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
--
1.7.10.4