Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial port of little-kernel to vc4 #259

Draft
wants to merge 101 commits into
base: master
Choose a base branch
from

Commits on Jan 14, 2020

  1. [platform][vc4] initial port of little-kernel to vc4

    some parts are copy/pasted from https://github.com/cleverca22/rpi-open-firmware
    which itself is a fork of https://github.com/christinaa/rpi-open-firmware
    
    what works:
    network booting lk.elf on an rpi4 (just rename to start4.elf and host over tftp)
    the full console with line editing and history
    serial over pl011 (but no serial init, relies on previous bootloader stage)
    reboot command
    irq handling for timer compare and uart
    one-shot timer
    reporting cpu exceptions such as divide by zero
    cleverca22 committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    ed6bcd6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6177b60 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b87e962 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2020

  1. Configuration menu
    Copy the full SHA
    6e53a65 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2020

  1. fix CI and enable hw led

    cleverca22 committed Jan 24, 2020
    Configuration menu
    Copy the full SHA
    63983b1 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2020

  1. Configuration menu
    Copy the full SHA
    7688dad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    34a6c86 View commit details
    Browse the repository at this point in the history
  3. add the basis for nix CI

    cleverca22 committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    8057162 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e6aa53e View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2020

  1. move the vector table

    cleverca22 committed Jan 30, 2020
    Configuration menu
    Copy the full SHA
    964020e View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2020

  1. Configuration menu
    Copy the full SHA
    265ddb4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8a1796 View commit details
    Browse the repository at this point in the history
  3. fix CI errors on hydra

    cleverca22 committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    bba0459 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2020

  1. many improvements

    add sdhost code
    add gpio pullup test
    fix peripheral address
    implement batch gpio pull config changes
    fix memory information to be based on boot stage, not model
    add rpi4 recovery.bin support
    cleverca22 committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    bbd44bf View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2020

  1. Configuration menu
    Copy the full SHA
    2a56c6f View commit details
    Browse the repository at this point in the history
  2. Re-implement OTP access

    This is a clean rewrite of the OTP routines using new findings.
    ptesarik committed Feb 22, 2020
    Configuration menu
    Copy the full SHA
    b5f15ad View commit details
    Browse the repository at this point in the history
  3. otp_write command

    Based on previous research, this commit implements a write command.
    
           Use with care!
    What is done cannot be undone.
    ptesarik committed Feb 22, 2020
    Configuration menu
    Copy the full SHA
    a92f697 View commit details
    Browse the repository at this point in the history
  4. Rename OTP_STAT_PROG_OK to OTP_STAT_PROG_ENABLE

    This bit does not tell whether programming was OK, but whether
    programming is enabled. Renaming should prevent confusion when
    BCM283x support is added.
    ptesarik committed Feb 22, 2020
    Configuration menu
    Copy the full SHA
    37a056c View commit details
    Browse the repository at this point in the history
  5. OTP write support for BCM283x

    The OTP chip in BCM283x cannot program a full word in a single
    command. Instead, individual bits must be programmed one by one.
    
    There is also a subtle difference in program enable. The magic
    sequence must be written to OTP_BITSEL, not OTP_DATA.
    
    Tested on a RPi3 B (no plus).
    ptesarik committed Feb 22, 2020
    Configuration menu
    Copy the full SHA
    e07d1f8 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2020

  1. Configuration menu
    Copy the full SHA
    b310295 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from ptesarik/vc4

    Enhance OTP handling
    cleverca22 committed Feb 25, 2020
    Configuration menu
    Copy the full SHA
    6ddcdc6 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2020

  1. Add missing PLL hw register definitions

    Get rid of hardcoded values in pll_control.c
    ptesarik committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    7b8171a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84aba01 View commit details
    Browse the repository at this point in the history
  3. Constify the PLL definition table

    It should not be modified, so it may go into read-only data.
    ptesarik committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    5fa7811 View commit details
    Browse the repository at this point in the history
  4. Make PLL definitions globally available

    This change allows reusing the data from other modules.
    ptesarik committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    30e6929 View commit details
    Browse the repository at this point in the history
  5. Make a single A2_PLL_FRAC_MASK macro

    All PLLs have a 12-bit fractional part. There is no need to
    complicate matters by defining per-PLL masks.
    ptesarik committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    b73f135 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fb53a2e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8bc41de View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    71a9556 View commit details
    Browse the repository at this point in the history
  9. Remove unneeded pllX() functions

    The definition of these functions is now trivial, so expose the
    underlying get_pll_freq() and get_pll_chan_freq() instead.
    ptesarik committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    dd73f4e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0420cc6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4580228 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f926545 View commit details
    Browse the repository at this point in the history

Commits on Feb 29, 2020

  1. get_pll_freq: Fix use of pre-dividers

    The sense of the "dividers" is currently reversed:
    - bit 14 / 11 in the ANA1 register _doubles_ the resulting PLL
      frequency,
    - PDIV field in the PLL_CTRL register divides the resulting
      frequency by an integer
    ptesarik committed Feb 29, 2020
    Configuration menu
    Copy the full SHA
    e00822e View commit details
    Browse the repository at this point in the history
  2. handle starting a PLL

    Some magic values must be written to the PLLx_DIG registers to take
    a stopped PLL out of RESET.
    
    It is also a good idea to hold all PLL channels while doing so.
    ptesarik committed Feb 29, 2020
    Configuration menu
    Copy the full SHA
    b410017 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2020

  1. Fix get_pll_freq on RPi4

    The prescaler is either not present on a BCM2711, or it works
    differently. For the record, the PLLC NDIV:FRAC divider is set up
    to 3 GHz by the firmware as if there was no prescaler.
    ptesarik committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    659558d View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2020

  1. Rename ANARST and DIGRST bit masks

    These bits are common to all CM_PLL registers.
    ptesarik committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    6aeb35d View commit details
    Browse the repository at this point in the history
  2. Consolidate common PLL control register bits

    Since the PDIV field and PRSTN bit are found on the same positions
    in all PLLs, one single define is sufficient. It may even allow
    some optimizations in the compiler.
    ptesarik committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    ebd0961 View commit details
    Browse the repository at this point in the history
  3. Move xtal_freq to pll.h

    This variable can be useful to any clock-related code, so let's
    have the declaration in a common header file.
    ptesarik committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    ac4ac8b View commit details
    Browse the repository at this point in the history
  4. Rename ana1_pdiv_bit to ana1_prescale_bit

    I'm quite confident now that this bit controls a prescaler in the
    feedback loop, so give it a better name, so it cannot be confused
    with the PDIV field.
    ptesarik committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    cfdd1eb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    53dc6ba View commit details
    Browse the repository at this point in the history
  6. set_pll_freq command

    Change the PLL frequency.
    ptesarik committed Mar 6, 2020
    Configuration menu
    Copy the full SHA
    8429abc View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2020

  1. Configuration menu
    Copy the full SHA
    ba3f97a View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2020

  1. I2C raw transfer function

    Quite useful to research the undocumented internal I2C bus on
    BCM2711 (bus 7). For example, I can control the PWR LED on my RPi4B
    like this:
    
    Turn off:
      i2c_xfer 7 0x43 0504 0
    Turn on:
      i2c_xfer 7 0x43 0500 0
    ptesarik committed Mar 8, 2020
    Configuration menu
    Copy the full SHA
    55fb47a View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2020

  1. i2c_set_rate

    The pre-configured I2C bus rate is too high for MxL7004 on a RPi4
    after start4.elf is launched (over 900 kHz). The spec says the
    maximum SCL clock frequency is 400 kHz, but the firmware uses an
    even lower value (100 kHz).
    
    FWIW 400 kHz does not work on my RPi4B, but maybe the default
    FEDL/REDL calculation does not satisfy the SCL_H and/or SCL_L
    period requirements of that chip. Who cares... just use 100 kHz.
    ptesarik committed Mar 9, 2020
    Configuration menu
    Copy the full SHA
    da1995d View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. implement sdhost

    cleverca22 committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    c27e129 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    73356d1 View commit details
    Browse the repository at this point in the history
  3. jitter test

    cleverca22 committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    67fa6b0 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2020

  1. implement clock measuring

    cleverca22 committed Aug 23, 2020
    Configuration menu
    Copy the full SHA
    453f4ef View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2020

  1. begin the vc4-stage1 binary

    it will bring up the DDR2 controller
    then mount an ext2 fs on SD partition 2
    then drop into a shell for testing
    cleverca22 committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    1da15f1 View commit details
    Browse the repository at this point in the history
  2. fix release file

    cleverca22 committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    573b1a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    81eddd7 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. Configuration menu
    Copy the full SHA
    b0b46be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc3a357 View commit details
    Browse the repository at this point in the history
  3. redo alignment again

    cleverca22 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    ce5757d View commit details
    Browse the repository at this point in the history
  4. fix use after free

    cleverca22 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    7d8e9af View commit details
    Browse the repository at this point in the history
  5. build stage2 on CI

    cleverca22 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    0a982f0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e9a8f0e View commit details
    Browse the repository at this point in the history
  7. add a hydra-build-products

    cleverca22 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    6396c6e View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2020

  1. Configuration menu
    Copy the full SHA
    697c381 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. improve stage1 more

    fix DPI clocks and hsync/vsync generation
    implement HVS code
    cleverca22 committed Sep 14, 2020
    Configuration menu
    Copy the full SHA
    18a4f56 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2020

  1. Configuration menu
    Copy the full SHA
    1b69585 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2020

  1. Configuration menu
    Copy the full SHA
    6c501e2 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2020

  1. Configuration menu
    Copy the full SHA
    34483f7 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2020

  1. Configuration menu
    Copy the full SHA
    fa37f8b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e2367de View commit details
    Browse the repository at this point in the history
  3. build rpi2-test on hydra

    cleverca22 committed Oct 9, 2020
    Configuration menu
    Copy the full SHA
    d587d3b View commit details
    Browse the repository at this point in the history
  4. implement image loading

    cleverca22 committed Oct 9, 2020
    Configuration menu
    Copy the full SHA
    531aba7 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2020

  1. Configuration menu
    Copy the full SHA
    e9db3ab View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2020

  1. Configuration menu
    Copy the full SHA
    79eb929 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2020

  1. fix rpi3-test on CI

    cleverca22 committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    6aed09c View commit details
    Browse the repository at this point in the history
  2. missed a platform change

    cleverca22 committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    8f27630 View commit details
    Browse the repository at this point in the history
  3. and this too

    cleverca22 committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    fda45ef View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5ae9f70 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    199cb4a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7b88aa7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    42ef69f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cba5030 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2020

  1. arm1176 fixes

    cleverca22 committed Oct 17, 2020
    Configuration menu
    Copy the full SHA
    4081cf6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a91059b View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2020

  1. partially implement dwc2 device mode code

    overhaul arch setup for targets
    add support for .text.bootloader_state on the pi4
    cleverca22 committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    abdf484 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2020

  1. Configuration menu
    Copy the full SHA
    2e4a35f View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2020

  1. saving before mass-delete

    cleverca22 committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    4a93a73 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    43f9cf2 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2021

  1. move dwc code to its own module, it currently crashes on boot if the …

    …bootloader hasnt initialized things
    cleverca22 committed Jan 8, 2021
    Configuration menu
    Copy the full SHA
    800027b View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2021

  1. Configuration menu
    Copy the full SHA
    1528f64 View commit details
    Browse the repository at this point in the history
  2. clean up dwc2 code

    cleverca22 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    ab4d081 View commit details
    Browse the repository at this point in the history
  3. fix a missing include

    cleverca22 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    8166bb5 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2021

  1. Configuration menu
    Copy the full SHA
    5f01019 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2021

  1. missed this file

    cleverca22 committed Mar 20, 2021
    Configuration menu
    Copy the full SHA
    163a6ea View commit details
    Browse the repository at this point in the history
  2. and this file!

    cleverca22 committed Mar 20, 2021
    Configuration menu
    Copy the full SHA
    51fe20e View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2021

  1. Configuration menu
    Copy the full SHA
    d1ce174 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    86ecba0 View commit details
    Browse the repository at this point in the history
  3. fix vc4-stage1

    cleverca22 committed Mar 21, 2021
    Configuration menu
    Copy the full SHA
    1787a2e View commit details
    Browse the repository at this point in the history
  4. and vc4-stage2

    cleverca22 committed Mar 21, 2021
    Configuration menu
    Copy the full SHA
    8043bb7 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2021

  1. vec dance works

    cleverca22 committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    715ef3e View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2021

  1. arm looks to be starting?

    cleverca22 committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    af84c4d View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2021

  1. dtop generating pi-logo.h

    cleverca22 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    8687ab0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15741ea View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2021

  1. fix dpi.c

    cleverca22 committed Mar 29, 2021
    Configuration menu
    Copy the full SHA
    38dbc0f View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2021

  1. remove unused code

    cleverca22 committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    d8738f0 View commit details
    Browse the repository at this point in the history