1. 14 Mar, 2020 3 commits
    • 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
      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
  2. 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
  3. 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
  4. 31 Jul, 2017 1 commit
    • Jeffrey Lee's avatar
      Fix compatibility with latest firmware · d58d5839
      Jeffrey Lee authored
      Detail:
        Firmware as of 28th July will allow the GPU to make use of the top 16MB of RAM in 1GB machines. This overlaps the ARM's IO space, essentially making that area of memory inaccessible to us.
        This causes problems because we rely on a couple of buffers which are located in VC memory (virtual GPIO buffer & FT5406 touchscreen buffer)
        At some point extra mailbox messages were added to allow the ARM to dictate the location of these buffers; so make use of those messages wherever possible.
        File changes:
        s/Messaging - Remove VirtGPIOBuf and TouchBuf related tags from the initialisation tag sequence. Add new GetVCBuffer function that can be called post-MMU init to deal with getting/setting the buffer addresses.
        s/Top - Use GetVCBuffer to initialise VirtGPIOBuf
        s/Touch - Use GetVCBuffer to get touchscreen buffer
        hdr/StaticWS - Remove TouchBuf from workspace, no longer needed
      Admin:
        Tested on Raspberry Pi 3 with firmware from March 2016 (Set commands not supported), 21st July 2017 (set commands supported, but upper 16MB not used), 28th July 2017 (set commands supported and necessary)
      
      
      Version 0.71. Tagged as 'BCM2835-0_71'
      d58d5839
  5. 21 Feb, 2017 3 commits
    • Robert Sprowson's avatar
      Add support for CM3 and CM3L with or without eMMC · 6eeefb37
      Robert Sprowson authored
      The SDIO HAL device reports when it is sure fixed disc media is attached (ie. eMMC soldered on the same PCB) which causes SDFS to report this to FileCore as a fixed disc, skipping the removable safety checks.
      However, CM3 and CM3L both return the same board id so we can't work out which is which. Additionally, someone could attach an external eMMC in theory on a custom expansion board (instead of an SD card socket like the CMIO has).
      To resolve this, we assign IO expander line 6 of U8 to be a safety catch. If that line is held low, it signifies this is definitely a CM3 - in effect this is a "definitely has eMMC" or "maybe has eMMC" switch.
      
      Tested on CM1, CM3, CM3L, and a suitably modified CM3 with the help of Chris Hall.
      
      Version 0.69. Tagged as 'BCM2835-0_69'
      6eeefb37
    • Robert Sprowson's avatar
      Refactor early GPU queries · e65005cf
      Robert Sprowson authored
      Remove the baffling double indirection of RamAd (and unused exports SerNo and MacAdd), and treat these the same as the other pre-HAL_Init query results.
      This means the scope of the tagbuffer is limited to Messaging.s, rather than having to be kept preserved globally.
      Use memcpy() to copy tag list to tagbuffer for clarity.
      Tested on a Pi 3.
      
      Version 0.68. Tagged as 'BCM2835-0_68'
      e65005cf
    • Robert Sprowson's avatar
      Fix for register corruption · 62e5efb4
      Robert Sprowson authored
      In HAL_QueryPlatform a mixture of register naming overlooks r6 (aka v3) gets used, but not preserved.
      Uppercase opcodes, add a few more comments around the CRC calculation.
      62e5efb4
  6. 26 Mar, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix SD card activity LED on Pi 3B · 3e87de33
      Jeffrey Lee authored
      Detail:
        hdr/BCM2835 - Remove mailbox definitions - use the ones exported by BCMSupport to avoid needless duplication
        hdr/StaticWS, s/Messaging, s/Top - Use the mailbox property interface to request & map in the virtual GPIO buffer (if present)
        s/SDIO - On the Pi 3B, the GPIO that was used for the SD activity GPIO is now used for a different purpose. To control the activity LED we need to go via an I2C attached GPIO extender, which itself is exposed to the ARM via the new "virtual GPIO" buffer
        s/VCHIQ - Update to use BCMSupport mailbox definitions
      Admin:
        Tested on Pi 1B, 3B
      
      
      Version 0.54. Tagged as 'BCM2835-0_54'
      3e87de33
  7. 25 Mar, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix Pi 3 UART clock rate. Add HAL device for the GPU mailboxes. · c1a6cf63
      Jeffrey Lee authored
      Detail:
        s/Messaging - Ensure the PL011 UART module clock is set to 3MHz on startup, in order to allow the debug terminal to work
        hdr/StaticWS, s/Top - Add a basic HAL device to expose the GPU mailboxes
      Admin:
        Tested on Raspberry Pi 1B/2B/3B
        Fixes garbled debug terminal input/output on Pi 3
      
      
      Version 0.52. Tagged as 'BCM2835-0_52'
      c1a6cf63
  8. 15 Nov, 2015 1 commit
    • Jeffrey Lee's avatar
      Add basic HAL device for the official DSI display/touchscreen. Delete superfluous code. · 76db1228
      Jeffrey Lee authored
      Detail:
        Makefile, s/Touch - Basic HAL device for the official touchscreen, which just exposes the address of the buffer which the GPU periodically fills with a register dump of the touchscreen controller.
        hdr/BCM2835 - Remove old comment. Add new tag for getting the touchscreen buffer address.
        hdr/StaticWS - Remove old workspace entries. Add new entries for touchscreen.
        s/Messaging - Remove the messagebox tags which set a screen mode on startup (BCMVideo will handle that for us), and just blank the screen instead (to stop the GPU displaying a coloured square). Add tag to get the touchscreen buffer address.
        s/Top - Register touchscreen HAL device during HAL_InitDevices. Remove more old code.
      Admin:
        Tested on Raspberry Pi 1 B
      
      
      Version 0.50. Tagged as 'BCM2835-0_50'
      76db1228
  9. 02 Feb, 2015 1 commit
    • Ben Avison's avatar
      Add support for Raspberry Pi Compute module and Raspberry Pi 2 · 60752490
      Ben Avison authored
      Detail:
        * Compute module support consists of eMMC support in the SDHCI driver. The
          eMMC chip on the Compute module only works reliably if under-clocked to
          25 MHz.
        * Pi 1 vs Pi 2 differences are selected at runtime by checking the CPU ID,
          so a single ROM image will work with both boards.
        * Added ARMv7 cache maintenance routine for use on Pi 2.
        * The physical address of the peripherals has moved in Pi 2 to make space
          for the 1 GB of RAM.
        * The ARM physical address space is mapped differently onto the GPU
          address space in Pi 2 because the ARM now uses the L2 cache that comes
          with the Cortex-A7 instead of the GPU's L2 cache.
        * Still waiting for confirmation on the board revision ID that will be
          used for Pi 2, so may require further tweaks for production releases.
      
      
      Version 0.40. Tagged as 'BCM2835-0_40'
      60752490
  10. 18 Sep, 2012 1 commit
    • Jeffrey Lee's avatar
      Add a video HAL device to allow BCMVideo to determine which DMA channel it can use for render ops · 47a0e5d7
      Jeffrey Lee authored
      Detail:
        hdr/StaticWS, s/Top, s/Video - Added a simple VDU HAL device that exposes a DMA channel to BCMVideo for use with GraphicsV_Render
        hdr/BCM2835 - Don't allow DMA channel 12 to be used; latest firmware seems to have a bug which claims its free when in reality it isn't.
        s/Messaging, s/DMA - Adjust DMA init to allow the video device to claim a DMA channel before the DMA devices are initialised
      Admin:
        Tested on Raspberry Pi with high processor vectors
      
      
      Version 0.25. Tagged as 'BCM2835-0_25'
      47a0e5d7
  11. 08 Sep, 2012 1 commit
    • Jeffrey Lee's avatar
      Read board model, revision, and available DMA channels from messaging channel.... · 59e36802
      Jeffrey Lee authored
      Read board model, revision, and available DMA channels from messaging channel. Report board revision via GPIO HAL device. Recover lost ROM relocation code.
      
      Detail:
        hdr/StaticWS, s/Messaging, s/Top - Now reads board model, revision and available DMA channels from messaging channel
        hdr/StaticWS, s/GPIO - Updated GPIO HAL device to report board revision instead of a generic response of 'unknown'
        s/Top - Recovered ROM relocation code that got lost during a merge. End of ROM image no longer being corrupted, and RISC OS now sees correct amount of RAM.
        s/DMA - Ditch old code to read available DMA channels and use value read by HAL_QueryPlatform instead.
      Admin:
        Tested on Raspberry Pi (B rev 1) with various start.elf sizes & versions
        DMA channel reporting only available with latest firmware (i.e. 8th Sep)
        Board revision number read by messaging channel seems to match that returned by /proc/cpuinfo on Linux
      
      
      Version 0.22. Tagged as 'BCM2835-0_22'
      59e36802
  12. 02 Sep, 2012 1 commit
    • Jeffrey Lee's avatar
      Strip out video code & on-screen debug · d56f8a14
      Jeffrey Lee authored
      Detail:
        Makefile, s/Display - Deleted on-screen debug code
        hdr/BCM2835, hdr/StaticWS, s/IIC, s/Messaging, s/Stubs, s/Top, s/UART - Strip out calls to on-screen debug code, and a few bits of video code
        s/Video - Video code removed and replaced with stub functions similar to other HALs. Only remaining useful code is HAL_Video_StartupMode, which in time should probably be moved to BCMVideo as well.
      Admin:
        Tested on Raspberry Pi with high processor vectors
      
      
      Version 0.21. Tagged as 'BCM2835-0_21'
      d56f8a14
  13. 22 Jul, 2012 1 commit
  14. 19 Jul, 2012 1 commit
    • John Ballance's avatar
      Various updates to do with the messaging channel, HAL_MachineID, and HAL_Reset · ef241880
      John Ballance authored
      Detail:
      	HAL_Reset now causes a complete reboot of the machiine. It isnt yet properly called from
      	the kernel.. I've not investigated why yet. Behaviour tested using OS_Hardware call
      
      	HAL_MachineID, with the github start.elf from 18 July 2012 will provide a valid MAC address ..
      	i.e. that specific to this machine. The a1 value in HAL_ExtendedID needs to be set 0 for this to be reported
      	by OS_ReadSysInfo .. unfortunately, again at this stage, it stalls the boot when set 0, so just for now
      	the committed value for a1 in HAL_ExtendedID is not 0 .
      
      	centralised messaging routine added. This is used a fair bit in acquiring the operating environment
      	Not yet used in the DMA stuff. probably ought to be. At present the messaging channel this mainly
      	handles is not complete, so information from this code is still WIP
      
      Admin:
        (highlight level of testing that has taken place)
        (bugfix number if appropriate)
      
      
      Version 0.14. Tagged as 'BCM2835-0_14'
      ef241880