aboutsummaryrefslogtreecommitdiff
path: root/board-js2x
AgeCommit message (Collapse)AuthorFilesLines
2023-03-28Fix typos in the board-js2x folderThomas Huth8-21/+20
Found with the "codespell" utility. I kept "busses" which codespell also complains about since it seems to be an old but still valid plural of the word "bus". Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2021-10-01js2x: Fix compile and cleanupAlexey Kardashevskiy2-13/+16
This moves shared symbols out from the header file and leaves only the minimum in bmc.h. This fixes a "while (...); {" bug spotted by the modern gcc. This fixes cleanup as otherwise the board-js2x/Makefile's "clean" tries cleaning "rtas" which tries cleaning all libs (not just the ones it uses) and that in turn triggers generation of lib/libtpm/Makefile.dep which fails due to missing ./board-js2x/include/version.h. This fixes create_reloc_table.sh to build with newer toolchains which otherwise fail with: ld: cannot use executable file 'reloc_table.o' as input to a link This adds js2x compile to the travis script to know when it breaks again. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-11-06board-qemu: Fix slof-build-id lengthAlexey Kardashevskiy1-1/+1
The existing code hardcodes the length of /openprom/model to 10 characters even though it is less than that - len("aik")==3. All 10 chars go to the device tree blob and DTC complains on such a property as there are characters after terminating null: aik@fstn1-p1:~$ dtc -f -I dtb -O dts -o dbg.dts dbg.dtb Warning (model_is_string): "model" property in /openprom is not a string This uses the real length and limits it by 10 to avoid breaking something. Since the same code parses the build id field, this moves from-cstring to a common place for both js2x and qemu boards. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-07-20Define 'open' and 'close' words of the /aliases nodes right from the startThomas Huth1-5/+0
It's much easier to do this when we create the node instead of looking up the device node again later in each of the boards. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-06-06pci: Remove unused next-pci-[mem|mmio|io] functionsThomas Huth1-1/+1
The next-pci-mem and next-pci-mmio Forth words are completely unused, and pci-next-io is only used in one location (which can easily be replaced), so let's get simply rid of these legacy functions. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-04-26Rework the printing of the banner during bootThomas Huth1-0/+6
If the initial boot attempt fails, for example because the file that we downloaded via TFTP is not executable, or because the user exited grub instead of booting a kernel, SLOF prints out the banner text twice. This is quite ugly. Fix it by avoiding to print the banner during the first boot attempt, i.e. by adding the ".banner" command to the "boot" command only after we've done the first attempt via "start-it". Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1443904 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-04-26logo: Update the logoAlexey Kardashevskiy1-3/+0
This removes old ugly logo to save precious boot cycles and make it easier to do automation scripts. This removes logo for both QEMU and JS2x boards. As .banner does not call .slof-logo anymore, this also removes redefinitions of .banner. While we are here, this updates a year in the copyright notice for the QEMU board. This also removes some spaces from the standard banner. Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Thomas Huth <thuth@redhat.com>
2016-09-14Do not include the FCode evaluator by default anymoreThomas Huth3-4/+8
Commit 2fed5652819ad26627a8 ("Always include evaluator, move framebuffer token init to fbuffer.fs") made sure that the FCode evaluator is always included, during each boot cycle. The basic idea was that we would soon be starting to support PCI cards with FCode drivers on them. However, this has never happened, and so this change was in vain. The bad thing is now that the inclusion of the FCode evaluator also takes a lot of precious boot time, e.g. when running in QEMU TCG mode, it is more than a second. So to be able to boot faster again, disable the FCode evaluator by default again and put it into the ROM-fs instead (so it still can be loaded manually with "include evaluator.fs" if necessary). Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-06-27net: Move files from clients/net-snk/app/netlib/ to lib/libnet/Thomas Huth1-1/+2
When we want to link the network stack to other parts of the firmware later (paflof), we've got to turn it into a proper library first. Note: Make sure to run "make distclean" after this patch, so that the dependencies for the moved files get rebuilt properly. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-05-02base: Move cnt-bits and bcd-to-bin to board-js2x folderThomas Huth2-0/+13
These functions are only used by some ancient js2x code, so move them to that folder accordingly. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-14Fix dma-alloc and dma-map-in functions on board-js2xThomas Huth2-1/+32
Since slof/fs/dma-function.fs has been introduced for board-qemu, these function definitions shadow the original js2x functions from slof/fs/pci-config-bridge.fs, because dma-functions.fs is included after pci-config-bridge.fs in slof/fs/pci-bridge.fs. To restore the original behavior, move the js2x functions into a board-specific dma-function.fs file instead and include that one into the ROM-fs instead of the version for board-qemu. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-11-03qemu/js2x/client: Support binutils >= 2.25.1Alexey Kardashevskiy2-3/+2
The recent binutils version introduces explicit definition of a TOC symbol which points to the .toc section and enforces .toc alignment to 256 rather than 8 bytes before. For now the TOC symbol points to same location as it was before - start of .toc + 0x8000; however as this might change, we should not rely on that in the source code. This changes __toc_start (for qemu and js2x boards), _got (for net-snk, takeover, rtas) in linker scripts to use explicitely defined TOC if defined and fall back to the older scheme if not. This changes r2 (the register pointing to TOC) setup code not to add 0x8000 as linker scripts do that now. Here is a bit more information about the change: https://sourceware.org/ml/binutils/2015-10/msg00124.html https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=a27e685fa0a6480bdb07e3be359558524cec89b7 Tested on 1. gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC) GNU ld version 2.23.2 2. gcc version 5.2.1 20151001 (GCC) GNU ld (GNU Binutils) 2.25.51.20150930 Reported-by: William Grant <wgrant@ubuntu.com> Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-30board-js2x: Add missing file dma-function.fsThomas Huth1-0/+1
The PCI scan code needs the functions from the file dma-function.fs - and this had been forgotten to be included in the rom filesystem of board js2x. So add it here, too, to avoid that the boot process aborts due to the missing functions. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-03fbuffer: Improve invert-region helperThomas Huth1-5/+8
The introduction of invert-region already speeded up the cursor drawing very much. But there is still space for improvement: So far invert-region is accessing the memory only byte by byte, but with some additional logic that checks the alignment of the address and the length of the area, we can also make this function to access the memory with half-word, word or long-word accesses. With this additional logic, invert-region-x is also no longer necessary and thus can be removed. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-29fbuffer: introduce the invert-region-x helperAlexey Kardashevskiy1-0/+4
This patch simply moves the slow RX based logic from fb8-invert-screen to board-js2x helpers and implement a fast hv-logical-memop based helper for board-qemu. And we can drop hcall-invert-screen ! Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> [aik: removed one empty line] Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-29fbuffer: introduce the invert-region helperGreg Kurz1-0/+4
The inner loop in fb8-toggle-cursor can be implemented with hv-logical-memop in board-qemu and get an incredible performance boost. Let's introduce a per-board helper: - board-js2x: slow RB based, taken from current fb8-toggle-cursor - board-qemu: faster hv-logical-memop based With standard graphical settings on board-qemu, we go from 512 hcall invocations per character down to 16. Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-03-12Fix rectangle drawing functions to work also with higher bit depthsThomas Huth2-59/+2
draw-rectangle, fill-rectangle and read-rectangle were only working with 8-bit color depth displays so far. This is fixed now for 16-bit, 24-bit and 32-bit color depths, too, by taking the "screen-depth" into account. And while we're at it, consolidate all the same copies of these functions into one common file (graphics.fs) so that we do not have to do these modifications multiple times in different files. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2015-03-12Use device-type Forth word to set up the corresponding propertyThomas Huth2-2/+2
It's easier to use "device-type" instead of creating the corresponding properties manually. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-10-29js2x: Fix buildBenjamin Herrenschmidt1-0/+0
Add a dummy version.c to please the Makefile Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-04-25Remove unused SLOF codeThomas Huth1-2/+0
This patch removes some code that is obsolete and completely unused nowadays. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Allow more than one client to open net devices simultaneouslyAvik Sil1-2/+2
When multiple clients are active simultaneously, they might open network devices that is already opened by other clients. This results in failure to transfer packets since obp-tftp package is not instantiated on each open. This patch resolves it by instantiating obp-tftp on each open. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Remove bcm57xx network driver as moduleAvik Sil2-5/+1
The driver has been moved to libbcm Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Remove e1000 network driver as moduleAvik Sil1-1/+0
The driver has been moved to libe1k Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add bcm57xx network driver in libbcmAvik Sil4-4/+106
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21js2x: more fixesNikunj A Dadhania3-1/+6
* Build fixes to include scsi files * Move usb-setup-hcidev out of board-qemu * Fix pci-bridge-probe to assign temporary ranges Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06js2x: use new usb stackNikunj A Dadhania2-15/+12
Fix the js2x build to compile and link the usb stack. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-05-13Make load-base a real environment variableBenjamin Herrenschmidt2-22/+20
It can be stored in nvram. It defaults to a platform specified default currently set to 256MB on js2x and 16K on qemu. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-01-04Spelling fixes in forth codeStefan Weil1-2/+2
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-01-04Spelling fixes in comments and debug messagesStefan Weil3-5/+5
Most of these errors were found by codespell: controler -> controller appropiate -> appropriate devide -> divide comming -> coming seperate -> separate reponsible -> responsible initialization -> initialization successfull -> successful whithin -> within recieve -> receive wich -> which occurence -> occurrence beggining -> beginning accessable -> accessible proccess -> process succesfuly -> successfully immediatly -> immediately prefered -> preferred avaliable -> available threshhold -> threshold statistsics -> statistics endianess -> endianness positon -> position writen -> written occurence -> occurrence upto -> up to overwriten -> overwritten availabe -> available enviroment -> environment intruction -> instruction thru -> through substract -> subtract occured -> occurred begining -> beginning lenght -> length atributes -> attributes preceeding -> preceding defintion -> definition decriptor -> descriptor Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2012-02-02New oco for JS20Thomas Huth1-0/+0
The old file did not work with new compilers anymore.
2011-12-28Enabled -Wmissing-prototypes and -Wstrict-prototypes CFLAGS and cleaned upThomas Huth4-43/+45
These two compiler flags for additional warnings help to improve the quality of the source code: Removed some unused code and fixed some obvious bugs. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20FCODE: Always include evaluator, move framebuffer token init to fbuffer.fsThomas Huth3-20/+5
Since the FCODE evaluator can be used for more than one PCI card now, the interpreter is now always included during boot. The framebuffer tokens are now only initialized when the code from fbuffer.fs is being used. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20JS2x: Added oco files to be able to built board-js2xThomas Huth2-0/+0
These additional files are necessary to built board-js2x, see the following URL for details: http://www.ibm.com/developerworks/power/pa-slof-js20/
2011-12-20JS2x: Fixed config space access functions.Thomas Huth1-1/+8
According to the PCI bus binding to Open Firmware, the uppermost byte can contain some description bits when doing "config-l@" and the like. For accessing the config space via MMIO, we've got to mask them away. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Silenced some compiler warnings that occur when compiling with prototype checksThomas Huth4-7/+12
The compiler flags -Wmissing-prototypes and -Wstrict-prototypes generally help to write code with proper prototypes. This way one can avoid some ugly bugs because it helps to identify functions that do not have prototypes in headers. It also helps to improve performance since local functions then have to be declared "static", so the compiler can do better optimizations. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17JS2x: Check whether biosemu has been executed successfullyThomas Huth1-5/+16
The code did not check whether biosemu has been executed successfully - and this of course caused problems when SLOF has been compiled without biosemu enabled. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17JS2x: Fixed bug in Citrine codeThomas Huth1-1/+4
While setting up the setsupbuff, the code wrote accidentially to memory at address 3 instead of setsupbuff+3. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17Fixed the PCI map-in function.Thomas Huth1-11/+8
The map-in function must retriev the BAR address from the config space address that is provided in the phys.hi parameter. We can not rely on the value in phys.lo as we did before. This patch is needed to get the FCODE from QLOGIC working, and it also revealed some bugs in the current version of our ATI rn50 driver (which uses map-in, too, to get the register base address). Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17Fixed config-xx PCI bus node functionsThomas Huth1-0/+9
According to the IEEE 1275 PCI bus binding, the config space address for the config-xx access functions should also always contain the bus-device-function numbers (i.e. "my-space"). The SLOF code behaved different so far by adding my-space during the config-xx words instead. This of course caused problems when running FCODE that expects the IEEE 1275 behaviour. The config-xx functions have now been changed to automatically detect the required behaviour: If the caller supplied a bus-device-function number, we do not add "my-space" in these functions anymore. However, our pci-bridge code for the AMD 8111 abused the old behaviour by accessing multiple devices+functions without specifying the full unit address. So for this device, special config-xx functions have been added to work-around this problem. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Added e1000 network driverThomas Huth1-0/+1
This driver can be used for downloading files via e1000 compatible NICs. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Moved bcm57xx driver to a new directory called "drivers".Thomas Huth2-16/+14
The bcm57xx driver is a normal part of the SLOF firmware, so it does not make sense that it resides in the other-licence directory. Moved it to a new directory called "drivers" now. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Set up PCI nodes on board-qemuThomas Huth1-2/+2
Populate the PCI device tree nodes with additional properties and words, and provide enough of the SLOF PCI framework to be able to use the nodes with our device specific drivers. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Move MMIO accessors to board-js2x and implement h-calls based ones for qemuBenjamin Herrenschmidt1-1/+2
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-10-12Cleaned up MakefilesThomas Huth2-42/+43
Replaced "make" by "$(MAKE)" to be able to built in parallel, fixed the indentation of some rules and removed some unused targets. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Fix compiler warningsThomas Huth1-3/+3
GCC 4.6 complains about unused-but-set variables - which can safely be removed in our cases. Also fixed a strict-aliasing problem in rtas_flash.c of board-js2x. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12JS2x: Detect the availability of biosemu automatically.Thomas Huth1-0/+6
Since the biosemu code is optional, the config file now determines its availability automatically. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Make net-snk and modules relocatable, too.Thomas Huth1-2/+2
Cleaned up the toc-relative assembly of net-snk, fixed the Makefiles, save the modules as ELF files instead of raw binaries, adjust the net-snk base address and the load-base variable... a lot of changes were required to make the net-snk and the snk modules relocatable, too. But now it should be possible to relocate all files so that the firmware also runs with less than 256 MiB RAM. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Got rid of the ELF loader functions written in Forth, using libelf instead.Thomas Huth2-8/+8
It's cumbersome to maintain code twice, in Forth and in C, and now that libelf has a new important feature (relocation), I removed most of the old Forth functions for ELF loading and use the libelf everywhere instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Reworked libelf to support relocationThomas Huth1-1/+4
Split elf.c into elf32.c and elf64.c for better readability. Added relocation code to libelf for 64-bit ELF images, modified the Paflof Makefile to link the executable with relocation information and load Paflof now to the upper end of the memory. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-03-22Fixed compiler warningThomas Huth1-1/+2
Silenced a compiler warning that was easy to fix. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>