GitLab has been upgraded to 13.3.6. If you encounter any issues mail code@riscosopen.org

  1. 01 Aug, 2020 2 commits
    • Robert Sprowson's avatar
      On Pi 4's with no VL805 firmware EEPROM, softload it · f84ef1c2
      Robert Sprowson authored
      Some Pi 4's - for example, the recently released 8GB variant - don't have the firmware EEPROM on the VL805 fitted. The VideoCore loads default firmware on power on in order to do USB booting, but when RISC OS takes over and does a PCI fundamental reset the VL805 ends up with no firmware running.
      Detect this (by peeking the firmware version) and use the NotifyXHCIReset mailbox message to cause the VideoCore to softload the firmware again. Earlier built PCBs *do* contain a firmware EEPROM and skip the mailbox message.
      
      By inspection with a prototype version in BASIC it appears the SCB access needs to be enabled for this to work, it previously wasn't, hence the extra PCI setup step.
      
      Also, reduce the PCI reset delay and rename PCIe_RGR1_SW_INIT1_POWERDOWN to more accurately reflect what it does.
      
      Version 0.89. Tagged as 'HAL_BCM2835-0_89'
      f84ef1c2
    • Robert Sprowson's avatar
      Don't return Pi 4-only GPIO in all enumerations · 227406f6
      Robert Sprowson authored
      The pin list table had the Pi 4-only alternates mixed in, the result of which is that enumerating the pins on something other than Pi 4 would return ghost alternates for peripherals that don't exist.
      Split the pin lists and pick the appropriate one.
      
      Also, add 2 missing board revisions that have sneaked out for 2B/3B.
      227406f6
  2. 01 Jul, 2020 1 commit
    • Jeffrey Lee's avatar
      Fix HAL_PhysInfo · 740691e6
      Jeffrey Lee authored
      CPUDetect was corrupting the pointer needed for storing the table size
      
      Version 0.88. Tagged as 'HAL_BCM2835-0_88'
      740691e6
  3. 22 Jun, 2020 1 commit
    • David Higton's avatar
      [490] Fix for pull up/down settings · 80ee0170
      David Higton authored
      Detail:
        The offset to the pull up/down clock register was computed in v4 but then v2 was used instead.
      
      Version 0.87. Tagged as 'HAL_BCM2835-0_87'
      80ee0170
  4. 19 Jun, 2020 3 commits
    • Jeffrey Lee's avatar
      Add some test code · d03dbbfd
      Jeffrey Lee authored
      From the deep dark recesses of my hard disc, some Pi 1-era test code for
      CPU & DMA driven PWM audio, now updated to run on Pi 2, 3, & 4.
      
      Version 0.86. Tagged as 'HAL_BCM2835-0_86'
      d03dbbfd
    • Jeffrey Lee's avatar
      DMA improvements & fixes · c6f51390
      Jeffrey Lee authored
      * Update DMA & DMA lite channels to work on Pi 4 (HAL_IRQClear calls
      needed)
      * Fix DMAL_Abort / DMAL_Reset to reset the channel properly (register
      muddle meant the old reset code wasn't doing anything - and wasn't a
      particularly great way of resetting anyway)
      * Fix DMAL_CurtailListTransfer not working very well
      * Fix IRQ mapping of channels 11-14, allowing channels 12-14 to be used
      * Implement support for Pi 4 DMA4 channels. On Pi 4 these are the only
      channels we'll bother using, since DMA & DMA lite have annoying
      restrictions on accessing RAM above 1GB
      c6f51390
    • Jeffrey Lee's avatar
      Add BCM memory barriers · de19ec44
      Jeffrey Lee authored
      The BCM2711 manual suggests that yes, the BCM2835-style memory barriers
      are still needed when accessing peripherals
      de19ec44
  5. 30 May, 2020 1 commit
    • David Pitt's avatar
      Update table for 4B revision 1.4 · 75c0e15f
      David Pitt authored
      Detail:
        The 8GB model has a new PCB revision too.
      Admin:
        Submission from David Pitt.
      
      Version 0.85. Tagged as 'HAL_BCM2835-0_85'
      75c0e15f
  6. 02 Apr, 2020 1 commit
    • Robert Sprowson's avatar
      Correct MAC endianness · d1804c84
      Robert Sprowson authored
      The MAC address when encoded as a Dallas unique id is in network byte order.
      For example, a Risc PC returns OS_ReadSysInfo 4 with r0=&A4123456 r1=&0000 because Acorn's EUI is 00:00:A4.
      
      Version 0.84. Tagged as 'HAL_BCM2835-0_84'
      d1804c84
  7. 14 Mar, 2020 20 commits
    • Robert Sprowson's avatar
      Update table for another 4B revision 1.2 · e2f95b6e
      Robert Sprowson authored
      The 2GB new minor revision is in the wild.
      Also tidy HAL_[Ext]MachineID leftovers.
      
      Version 0.83. Tagged as 'HAL_BCM2835-0_83'
      e2f95b6e
    • Robert Sprowson's avatar
      Update table for 4B revision 1.2 · 2c6dc7b6
      Robert Sprowson authored
      Minor DFM changes resulted in a new revision number
        https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
      but only for 4GB.
      2c6dc7b6
    • Robert Sprowson's avatar
      More sensible abstraction · 74eff4aa
      Robert Sprowson authored
      Give the ISPENDRn address directly, since its only the HAL that knows that iDev_GPU is encoded from 64+, rather than having to bake it into DWCDriver.
      74eff4aa
    • Robert Sprowson's avatar
      Make a substitute for MPHI · 08076575
      Robert Sprowson authored
      The MPHI is (ab)used by DWCDriver as a means to do a FIQ downgrade to IRQ, but Pi 4 has no MPHI, so instead we substitute the GIC (as the GICD_ISPENDRn can be used to cause an IRQ from software).
      08076575
    • Jeffrey Lee's avatar
      Let VCHIQ know which page list format to use · b33e2c7c
      Jeffrey Lee authored
      VCHIQ bulk transfers on Pi 4 use a different page list format, in order
      to allow for full use of the larger 36bit physical address space. Add a
      flags word to the VCHIQ HAL device so that we can let the VCHIQ module
      know what page list format it should use for the machine we're running
      on.
      b33e2c7c
    • Robert Sprowson's avatar
      Extend the PCI address table for 64b · d4f21a61
      Robert Sprowson authored
      The USB controller is at physical addresses outside 32b range, extend so that it can be picked up by PCI manager, and hence use its SWIs (rather than *Memory P) to see registers.
      Also write the interrupt number into the config space so it can be picked up.
      Requires PCI-0_18.
      d4f21a61
    • Robert Sprowson's avatar
      Add remaining PCIe setup steps · ae6f7f27
      Robert Sprowson authored
      Memory window now enabled on the VIA VL805, on-chip bridge set to forward memory transactions, ARM CPU to PCI address space translated.
      Since we know there's only the VIA chip on the bus, there's no dynamic probing going on like platforms that have PCI sockets. Its BAR settings are derived from defines at the top of PCI.s, so to browse the XHCI capability registers just peek at
        *Memory p 600100000 +20
      Only 1 of the 4 address space translation windows is used.
      ae6f7f27
    • Robert Sprowson's avatar
      Add EtherNIC HAL device · 223182f1
      Robert Sprowson authored
      Basic HAL device to expose the GENET peripheral for the driver.
      223182f1
    • Robert Sprowson's avatar
      Add preliminary PCIe setup steps · 5acaaf41
      Robert Sprowson authored
      Just enough pokes to be able to scan configuration space such that the VIA XHCI controller can be seen by PCI Manager. Note: at present there are no memory or IO windows open, so you can't (yet) see XHCI registers.
      5acaaf41
    • Jeffrey Lee's avatar
      Add GIC interrupt controller support for BCM2838. · 288ddd47
      Jeffrey Lee authored
      * Requires 'enable_gic=1' in config.txt (or Pi4 dtb to be present?)
      * IRQs are managed via the GIC, FIQs via the BCM2838 FIQ controller
      * Implemented in s.IntVC6 to avoid making s.Interrupts too
      confusing.
      * Previous VC6 interrupt support removed from s.Interrupts
      * From the OS's perspective, interrupt numbers mostly remain
      unchanged. However iDev_QA7 interrupts are unavailable, and some of
      the BCM2838 interrupts have been overlaid ontop of them.
      * Device drivers must take care to issue HAL_IRQClear, as that is
      a new requirement for this HAL
      288ddd47
    • Jeffrey Lee's avatar
      Fix debugging via UART0 · 045a679d
      Jeffrey Lee authored
      HAL_QueryPlatform was attempting debug output before the debug
      UART had been initialised. Since both the PL011 & MiniUART
      configuration depends on getting/setting firmware values, fix it
      by just removing the debug prints from HAL_QueryPlatform.
      045a679d
    • Ben Avison's avatar
      Support >1GB RAM · 9f19d29e
      Ben Avison authored
      RAM sizes above 1GB are not reported by the usual mailbox property, and it
      seems unlikely that this will change because the VC RAM allocation has to
      remain within the bottom 1GB of the address space (the VC still uses the
      upper two bits of its addresses for cache policy) and this property cannot
      describe a non-contiguous range. Use the board revision bitfield to recognise
      when additional general-purpose RAM exists above the VC allocation. For now,
      we're running in "low peripherals" mode, so the top 64MB of 4GB RAM machines
      is inaccessible. If the VC allocation is also 64MB, that means the startup
      banner of Pi 4 will read 960MB, 1984MB or 3968MB.
      
      Also fix HAL_PhysInfo (and by implication, OS_Memory 6 and 7) to report the
      full 35-bit physical address space on Pi 4. The `range` struct filled in by
      HAL_PhysInfo has not been extended to 64-bit physical addresses because it
      describes RAM, and for now at least, RAM just squeezes into 32-bit addresses.
      9f19d29e
    • Ben Avison's avatar
      Support EMMC2 controller · b1569c4f
      Ben Avison authored
      This controller is now preferred over the legacy EMMC controller, and it is
      capable of UHS speeds (pending support in SDIODriver).
      
      Requires RiscOS/Sources/HWSupport/SD/SDIODriver!4
      b1569c4f
    • Ben Avison's avatar
      Extended IRQ support, and FIQ support · 07348d58
      Ben Avison authored
      Both still use GIC bypass mode. Assuming for now that extended GPU peripherals
      can't support FIQ without GIC (it seems as though they either all use IRQ or
      all use FIQ, and RISC OS isn't set up for there being multiple FIQ sources
      active at once).
      07348d58
    • Ben Avison's avatar
      SD bugfixes · 004817c4
      Ben Avison authored
      Detail:
      * Implement SD activity LED for Pi 4
      * Remove inappropriate reprogramming of GPIO47 for Pi 3 B(+) and A+
      * Correct the value for SDHCIWriteInterval which is used during SetSDCLK()
      004817c4
    • Ben Avison's avatar
      GPIO support · bbe41f94
      Ben Avison authored
      Detail:
      * Board recognition for Pi 4
      * Updated the pin enumeration table to specify new functions available in Pi 4
        (I2C[3456], SPI[3456], UART[2345])
      bbe41f94
    • Ben Avison's avatar
      Enable SD controller · 8aac3b72
      Ben Avison authored
      Detail:
      * Efforts to get the faster EMMC2 controller working are ongoing. In the
        meantime, this enables the backward-compatible EMMC1 controller.
      * The method required to control the activity LED appears to have changed,
        yet again. I haven't worked out how yet, so this is currently
        non-functional.
      8aac3b72
    • Ben Avison's avatar
      Get IRQs working · 068d02ad
      Ben Avison authored
      Detail:
      * For now, this uses the legacy interrupt controller, whose register layout has
        unfortunately changed in some unhelpful ways. There is also a GICv2 in the
        SoC, which we will need to transition across to in order to use some of the
        newer peripherals (including USB3 and gigabit Ethernet).
      * This requires a corresponding set of changes to start.elf: substitute all
        three instances of &E30011E7 with &E3001000.
      * FIQs are not currently supported, as the legacy interrupt controller has
        changed how these are handled. It seems likely that we'll transition to
        GIC before too long, which means it's not worth bothering to implement them
        for the legacy interrupt controller.
      068d02ad
    • Ben Avison's avatar
      Minimal read-write support for mini-UART · 932e3f57
      Ben Avison authored
      Because the mini-UART clock is derived from the core clock, and this varies
      by hardware platform and even firmware version, move the initial mailbox
      read to before UART initialisation so that this information is available.
      932e3f57
    • Ben Avison's avatar
      Peripheral physical addresses have moved again · 0821d828
      Ben Avison authored
      Also:
      * the IO region previously used only for the QA7 extensions now holds a GIC
        as well on Pi 4, so give it a more generic name
      * there's a new, second peripheral IO region to map in as well
      0821d828
  8. 05 Feb, 2020 1 commit
    • Robert Sprowson's avatar
      Fix OS_SerialOp default handshaking use on Pi · 0b2f7c19
      Robert Sprowson authored
      The default state for the Serial device (aka OS_SerialOp, and redirection to serial via *FX) is to expect hardware handshaking. However the implementation of HAL_UARTModemStatus when ModemControl = {FALSE} state didn't set a return value so ended up returning a1 = the port number (=0) rather than valid status bits. In turn, DualSerial took that to mean CTS/DSR deasserted and refused to send anything.
      To a lesser extent HAL_UARTModemControl also affected, returning a1 = port number 0 too.
      For both, set a return value; the value is as though a cable is always present with RTS=CTS and DTR=DSR.
      
      Also, fix the bugs in ModemControl = {TRUE}. This also fakes DTR=DSR which status/control bits don't appear to be implemented in the UART peripheral. Tested briefly, checking CTS state when plugging/unplugging a cable.
      
      Version 0.82. Tagged as 'HAL_BCM2835-0_82'
      0b2f7c19
  9. 10 Aug, 2019 1 commit
    • Ben Avison's avatar
      Set shareability bit in page tables for IO region on Pi 2 onwards · 699a746a
      Ben Avison authored
      RISCOS_MapInIO does relatively little processing on the L1PT flags that the
      HAL passes to it. However, when modules come along later and try to locate
      IO again, using OS_Memory 13, access permissions are specified using a
      variation on dynamic area flags. The kernel translates from these to L1PT
      flags, and one of the rules it applies is that the shareability bit is set
      if on a multiprocessor system. On Pi 2 and later, this means it doesn't find
      a match amongst the sections that were mapped in by the HAL, and in practice
      this means BCMVideo ends up causing 16MB of IO space to be mapped in twice.
      
      Fix this by passing the L1_S flag to RISCOS_MapInIO on Pi 2 and later. This
      effectively frees up an additional 16MB of logical address space for dynamic
      areas.
      
      Version 0.81. Tagged as 'HAL_BCM2835-0_81'
      699a746a
  10. 02 Aug, 2019 1 commit
    • Ben Avison's avatar
      Address of mailbox given to GPU should have cacheability bits set correctly · 34d04d6b
      Ben Avison authored
      On entry to HAL_SendHostMessage, we ensure the contents of the mailbox buffer
      are flushed out to the ARM L2 cache (if applicable) and main memory. There
      were a couple of instructions to fill in the top two bits of the address
      before passing it to the VC, but they were commented out for reasons that are
      not clear.
      
      The effect of this is that the VC will look in its L1 and L2 caches for the
      data in the buffer. On Pi 1 and 0, this wouldn't be too bad, since ARM11
      didn't have its own L2 cache and would have written the data into the VC L2
      cache instead, meaning that there would only be coherencency problems if the
      VC L1 cache still contained the old contents of the address. On Pi 2-4, it's
      more risky, because the VC L2 cache could also be inconsistent with main
      memory at this point.
      
      Reinstating the top two bits doesn't appear to cause any ill effects I can
      see (tested on Pi 1 and 4), so put these instructions back in.
      
      Version 0.80. Tagged as 'HAL_BCM2835-0_80'
      34d04d6b
  11. 20 May, 2019 1 commit
    • Robert Sprowson's avatar
      Add Compute Module 3+ support · 12a389b2
      Robert Sprowson authored
      GPIO.s,hdr/BCM2835: Table of known ids updated
      SPI.s: Fix long broken compute module support (only the original CM1 would have exported SPI2 due to not checking for the new id scheme).
      Unrelated, SDIO.s: Use CallOS macro.
      
      Thanks to Chris Hall for testing this on a CM3+ 8GB model.
      
      Version 0.79. Tagged as 'HAL_BCM2835-0_79'
      12a389b2
  12. 25 Feb, 2019 1 commit
    • Robert Sprowson's avatar
      Check Board_Model only once · 7c2fe7dc
      Robert Sprowson authored
      Do an upfront check for the model being 0, if that ever changes there's probably something seriously different. Look only at the Board_Revision elsewhere.
      Add the other Compute module to the SPI2 check (though currently the checks don't consider "New" revision words).
      
      Version 0.78. Tagged as 'BCM2835-0_78'
      7c2fe7dc
  13. 01 Dec, 2018 1 commit
    • Robert Sprowson's avatar
      Appease Thor · 9a2c1030
      Robert Sprowson authored
      SDIO.s: a condition code mixup meant that during intense SD card activity the thunder bolt symbol would appear due to poking the non-LED lines on 3B+
      GPIO.s: extend the 'free for use' table to include 3A+ pins, otherwise it read off the end; add an ASSERT to catch this in future
      
      Version 0.77. Tagged as 'BCM2835-0_77'
      9a2c1030
  14. 26 Oct, 2018 1 commit
  15. 07 Jul, 2018 1 commit
    • Jeffrey Lee's avatar
      Merge SMP branch to trunk · 06491820
      Jeffrey Lee authored
      Detail:
        hdr/StaticWS - Reserve workspace for QA7 peripheral address, HAL-wide spinlock, and doorbell device
        Makefile, s/DBell - Add doorbell device implementation
        hdr/BCM2835 - Clean up dead macros, add new macros for spinlock claim/release and basic CPU detection. Define new IRQ numbers for the "QA7" peripheral.
        hdr/CastleMacros, s/Top - Generate two HAL descriptors and entry point tables: One for single-core machines and one for multi-core machines. This avoids some MP-related overheads on ARM11 models of Pi. Implement SMP HAL entry points.
        s/Interrupts - Add support for the QA7 interrupts. Although some interrupts can be flexibly routed to different cores, we currently stick with a static scheme.
        s/Messaging - Use CPUDetect macro
      Admin:
        Untested
        Requires Kernel-6_09
      
      
      Version 0.76. Tagged as 'BCM2835-0_76'
      06491820
  16. 10 Apr, 2018 1 commit
    • Robert Sprowson's avatar
      Debug UART typo & clarification · 8c7c60d9
      Robert Sprowson authored
      Top.s: HAL_UARTStartUp takes 0's based UART numbers, so the debug setup would go wrong (if HAL_UARTStartUp actually checked the value).
      UART.s: Re-express the baud register default value so its origin is clear.
      Retagged as BCM2835-0_75 as the (non-debug) version is binary identical.
      8c7c60d9
  17. 21 Mar, 2018 1 commit
    • Robert Sprowson's avatar
      Safe GPIO pins table updates · b0ddf21a
      Robert Sprowson authored
      Add Pi3 B+ and Zero W.
      Split out CM3 from CM1, since the CM3 reuses some high GPIO lines as bit bashed SMPSU IIC bus, so we can't offer those for GPIO like on CM1.
      
      Version 0.75. Tagged as 'BCM2835-0_75'
      b0ddf21a
  18. 19 Mar, 2018 1 commit
    • Jeffrey Lee's avatar
      Fix SD activity LED on 3B+ · f90ce9ec
      Jeffrey Lee authored
      Detail:
        hdr/BCM2835 - Add some new board revision values
        s/SDIO - Treat the 3B+ the same as the 3B when handling the activity LED. Also detect the Embest-manufactured CM1 and treat it the same as the Sony one.
      Admin:
        Tested on Raspberry Pi 3B+
      
      
      Version 0.74. Tagged as 'BCM2835-0_74'
      f90ce9ec