aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-21display.fs: fix palette entries for foreground and background colorsMark Cave-Ayland1-6/+7
Some versions of Solaris assume that the foreground color is stored in palette index 255 and the background color is stored in index 0. Make sure we do the same otherwise the Solaris video driver picks the background color for console text which ends up being invisible. Note that this already matches the default palettes in cgthree.fs and tcx.fs which were obtained from Sun documentation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-04-21display.fs: fix off-by-one errors in color palette initialisationMark Cave-Ayland1-2/+2
Loops in Forth are described using a limit and start value. Fix the limit so palette entry 255 is actually set. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-04-20SPARC32: fix up obp_dumb_mmap() and obp_dumb_munmap()Mark Cave-Ayland1-4/+14
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@ilande.co.uk>
2017-04-20pci: don't add simple open/close words to all PCI devicesMark Cave-Ayland1-6/+7
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@ilande.co.uk>
2017-04-20fw_cfg: implement fw-cfg-read-file Forth wordMark Cave-Ayland4-1/+38
Implement fw-cfg-read-file Forth word as a simple wrapper around fw_cfg_read_file(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-04-20fw_cfg: add fw_cfg_find_file() and fw_cfg_read_file() functionsMark Cave-Ayland2-0/+57
These allow OpenBIOS to locate fw_cfg files by name and then read them via the fw_cfg interface. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-04-20fw_cfg: split fw_cfg_read() into fw_cfg_read() and fw_cfg_read_bytes()Mark Cave-Ayland1-6/+18
This is in preparation for calling fw_cfg_read_bytes() separately when reading data from the fw_cfg interface. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-03-11pci: fix setup of 64-bit BARsMark Cave-Ayland1-2/+10
The current PCI implementation is designed for a 32-bit PCI bus. When a 64-bit BAR is encountered during PCI bus enumeration, currently we treat the MSB BAR the same as a standard 32-bit BAR, attempting to guess its size by setting to 0xffffffff and reading back the response which returns back an invalid size of 0 and fails. This has the effect of setting the MSB BAR to 0xffffffff meaning that 64-bit BARs are mapped at the top of PCI memory in the wrong location. Handle this case by ignoring the MSB BAR when we detect a 64-bit BAR leaving it at its default value of zero. This solves the issue by ensuring that all 64-bit BARs are mapped within 32-bit PCI space which is fine for the PPC/SPARC64 machines we care about. Most noticeably this solves the issue of virtio modern devices (which use 64-bit BARs under QEMU) causing a kernel panic upon startup on qemu-system-sparc64 because they are mapped at the wrong address by OpenBIOS. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-02-13pci: Do not use hard coded name for pci bus, get it from phandle insteadBALATON Zoltan1-10/+21
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-02-13pci: Use get_path_from_ph() function from libopenbiosBALATON Zoltan1-4/+1
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-02-11mac-parts.c: restrict checking of partition status flags to CHRP partitions onlyMark Cave-Ayland1-22/+19
Early versions of MacOS X don't correctly set the partition status flags when creating the OS partition. Relax the status flag checks so they are only applied to CHRP partitions which allows us to both meet the intention of the CHRP specification and also enable OpenBIOS to boot OS partitions from OSs such as MacOS X DPs. With thanks to Steven Troughton-Smith <steve@highcaffeinecontent.com> for the in-depth investigation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-02-10Fix spelling mistakesEdward Betts20-23/+23
Signed-off-by: Edward Betts <edward@4angle.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-01-27SPARC32 : Fix SMP bootOlivier Danet1-19/+12
Only the first CPU shall clear the RAM. Signed-off-by: Olivier Danet <odanet@caramail.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-01-27SPARC32: Remove SMP detection for SS-5Olivier Danet1-24/+12
SparcStation 5 can only use one CPU. Signed-off-by: Olivier Danet <odanet@caramail.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-11-23ppc: Fix PCI interrupt routing to match what qemu doesBenjamin Herrenschmidt1-1/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-28SPARC64: ensure the E (effect) bit is set for PROM TTE entriesMark Cave-Ayland3-4/+5
Milax (OpenSolaris) checks to see if this is the case, and panics on boot if the E bit isn't set for PROM mappings. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-28SPARC64: memory map mk48t59 RTC and store its address in the device treeMark Cave-Ayland1-0/+14
Milax (OpenSolaris) expects the RTC to be mapped by the PROM and faults on boot if the mapping is not present. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-28SPARC64: set up small iomem region for memory-mapped devicesMark Cave-Ayland2-5/+3
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: add spacec@, spacew@, spacel@ and spacex@ Forth wordsMark Cave-Ayland1-0/+135
These perform reads using the given ASI and are used by the Milax startup code. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: add support for kmdb kernel debuggerMark Cave-Ayland4-2/+135
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: increase Forth machine memory to 192KMark Cave-Ayland1-1/+1
Otherwise when trying to boot Milax with a debugger we run out of memory. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: comment out the context switch debug messageMark Cave-Ayland1-1/+1
Debugging under kmdb is constantly switching context upon entry/exit which causes a lot of noise on the console. This matches all other archs which don't emit a similar message upon switch. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: make sure globals are stored in the CPU context during I/D MMU trapsMark Cave-Ayland1-3/+73
During I/D MMU traps, the CPU switches to the alternate memory globals. Hence we must manually switch to the original globals when saving/restoring state. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: add %tba to saved state contextMark Cave-Ayland6-24/+21
This means we can remove the client_tba hack in the CIF prologue and also use the full SAVE_CPU_STATE() macro for entry. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23libopenbios: limit upper virtual memory range to ofmem_arch_get_virt_top()Mark Cave-Ayland1-1/+1
64-bit Solaris appears to overflow in its memory list calculations if the entire virtual memory space is represented in the available memory list. Enforcing the upper limit from the previous patch enables 64-bit Solaris 9 boot to get beyond the "VAC too big!" error message upon boot. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC64: set upper bound for virtual memory allocationsMark Cave-Ayland2-1/+3
Comparing with real device trees, the maximum virtual memory address available for allocation on sun4u machines is 0xff000000. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-23SPARC32: fixup available memory list and modify ofmem_arch_get_virt_top()Mark Cave-Ayland2-2/+2
In preparation for applying the ofmem_arch_get_virt_top() restriction to the virtual memory region, fix up the calculation of the available list tail plus increase the virtual memory region to cover the IO memory. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-22ppc: don't use virtual image stack for startup contextMark Cave-Ayland4-7/+8
Part of commit 070ea60 created a new stack within the virtual image for use by the startup context. Unfortunately the current implementations of virt_to_phys() as used by some drivers are incorrect which causes issues with some parts of OpenBIOS, notably the USB stack. Revert back to using the initial stack in start.S which ensures a 1:1 mapping between virtual and physical addresses to avoid such problems. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-22drivers/usb: Fix compiling with USB debugging enabledBALATON Zoltan2-2/+2
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16SPARC64: add basic read-only Forth register supportMark Cave-Ayland2-0/+157
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16SPARC32: add basic read-only Forth register supportMark Cave-Ayland2-0/+101
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16ppc: add basic read-only Forth register supportMark Cave-Ayland1-44/+83
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16ppc: fix off-by-one error for register r4 in context switchMark Cave-Ayland1-1/+1
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16libopenbios: don't display output on execution of "go" wordMark Cave-Ayland1-14/+2
The displayed output is only correct after a valid load, and so with subsequent enter/exits the information is noisy and actually wrong. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-16Make current CPU context available in ForthMark Cave-Ayland2-0/+10
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-10-15unix: fix openbios-unix buildMark Cave-Ayland1-0/+2
The previous context patch series accidentally omitted adding __context to openbios-unix causing a link failure. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11libopenbios: remove address parameter from start_elf()Mark Cave-Ayland9-19/+9
Now that each loader sets up its own context, there is no need to pass in the address or set up the context ourselves. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11libopenbios: remove conditional logic from go()Mark Cave-Ayland1-16/+1
Now that each loader sets up its own context, there is no longer any need for conditional logic in go(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11xcoff: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland3-8/+111
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11forth: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland2-23/+16
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11fcode: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland2-24/+11
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11elf: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland3-17/+15
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11bootcode: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland4-8/+36
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11aout: implement load/init-program as per IEEE-1275 specificationMark Cave-Ayland2-28/+31
load should place the file at load-base, whilst init-program should parse the memory at load-base and set up the context accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11libopenbios: move go() function into libopenbiosMark Cave-Ayland15-156/+62
Add an (arch-go) hook for architectures that need to do their own thing before starting an image, and switch the callers over to use it. Also clarify the state-valid check: any non-zero value is considered true. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11libopenbios: move prototypes for start_elf() and __context into libopenbiosMark Cave-Ayland6-14/+4
Also fix up the incorrect x86 prototype which is missing the volatile qualifier. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11SPARC64: remove start_client_image()Mark Cave-Ayland3-17/+4
Since the client context is now set by arch_init_program(), start_elf() and start_client_image() are now identical so the latter can be removed. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11elf: set boot notes in elf_load() if suppliedMark Cave-Ayland13-42/+30
Since the parameter is now already available to arch_init_program(), there is no need to supply it separately to start_elf(). Remove the second parameter and fix up the callers, including standardising the prototype of start_elf() across all architectures. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11x86: move Forth/FCode over to use new context wrappersMark Cave-Ayland1-12/+6
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-09-11SPARC64: move Forth/FCode over to use new context wrappersMark Cave-Ayland1-12/+4
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>