Skip to content
ljkenny edited this page Oct 19, 2014 · 57 revisions

This document details the effort to move to ARCH_BCM2835 and get drivers upstream.

ARCH_BCM2835
Mailing list: http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
Maintainer: Stephen Warren

Lubomir Rintel is doing work on several drivers: https://github.com/hackerspace/rpi-linux/commits/lr-vchiq-new-mailbox

Discussion: Issue #627

If you have knowledge in this area, please contribute. Consider using strikethrough instead of deleting things you regard as wrong/outdated.

Summary

DMA
bcm2835-dma (bcm2708-dmaengine OK)

Mailbox
bcm2835-mbox (work in progress)
Waiting for the Mailbox API to be included (now in linux-next).

Drivers depending on DMA and/or Mailbox
bcm2708_fb
bcm2835-mmc (OK)
bcm2835_hwmon (this is not upstream)
bcm2835-thermal (work in progress)
bcm2835-cpufreq (work in progress)
vchiq (a DT hack exists)
sound/arm/bcm2835.c (a DT hack exists, depends on vchiq)
drivers/gpu/drm/vc4 (rebase to upstream 2835+mailbox in progress) status of userspace

Drivers already upstream
irq-bcm2835 (no FIQ support)
pinctrl-bcm2835
spi-bcm2835
i2c-bcm2835
bcm2835_wdt
bcm2835-rng
bcm2835-i2s

VideoCore bootloader

Work is ongoing to get the bootloader to boot the vanilla kernel.

Several features that would make life easier regarding runtime editing of the DTB are not yet implemented. Currently, VC4 bootloader cannot:

  • Add nodes to the DTB
  • Remove nodes from the DTB
  • Resize the DTB in-place (requires that padding is used in the devicetree.dtb file).

The Videocore bootloader now supports the GPIOMAN configuration interface. This is the initial setup of GPIO pins done on boot by VC prior to booting the ARM: necessary for compute module implementations.

This is a devicetree-based videocore-only setup that is parsed independently of the elements that the ARM cares about. Details to be released in due course.

Drivers in mach-bcm2708 directory

armctrl

Role: Interrupt driver
BCM2708: armctrl
BCM2835: irq-bcm2835

irq-bcm2835 lacks FIQ support (PM33).

clock

Role: BCM2708 clock implementation
BCM2708: clock
BCM2835: clk-bcm2835.c

BCM2708 is now using the Common Clock Framework: PR #630

bcm2708_dma

Role: DMA driver
BCM2708: bcm2708_dma
BCM2835: bcm2835-dma

How does bcm2708_dma relate to bcm2708-dmaengine?

  • bcm2708_dma is an allocate-release driver to prevent trampling on Videocore channels. Becomes obsolete if the dma channels are passed in via the devicetree and parsed by bcm2835-dmaengine - a "status" property would mark which channels are reserved for VC4 use.

bcm2708_power

Role: Power driver
BCM2708: bcm2708_power
BCM2835: NYI

Chip power and clocking are currently under the exclusive control of Videocore. There is no documentation released for the power/clock domain management engines.

This driver provides a mailbox interface to power up/down the domains that notionally belong to the ARM, however currently this is not used by any of the peripheral drivers.

vc-mem

Role:
BCM2708: vc-mem

  • Userspace helper to get videocore mem addresses. What uses this?

bcm2708_vcio

Role: Mailbox driver
BCM2708: bcm2708_vcio
BCM2835:
WIP: bcm2835-mbox
This is waiting for the Mailbox API to be included:

Driver list

spi-bcm2708

Role: SPI master driver
BCM2708: spi-bcm2708
BCM2835: spi-bcm2835

spi-bcm2708 has 9-bit support implemented with the LoSSI mode. spi-bcm2835 doesn't have this. LoSSI mode isn't a general purpose 9-bit SPI, because some values triggers an automatic read by the controller. It is used with MIPI DBI type C interface compatible LCD controllers.

i2c-bcm2708

Role: I2C bus driver
BCM2708: i2c-bcm2708
BCM2835: i2c-bcm2835

bcm2708-dmaengine

Role: DMA Engine
BCM2708: bcm2708-dmaengine
BCM2835: bcm2835-dma
Both drivers are the work of Florian Meier and are probably similar.

This driver only supports cyclic DMA transfers, which is mainly for sound cards?
It seems slave_sg support is needed for MMC/FBDEV etc. (notro)

Alternative dmaengine driver: https://github.com/lp0/linux/blob/986c15594ae813839189a3cf9fde9da2511ca1c3/drivers/dma/bcm2708_dma.c

Internally, we have expanded the upstream dmaengine driver to include slave_sg support. To be submitted to the kernel mailing lists. (P33M)

slave_sg support added to bcm2708-dmaengine: dmaengine: expand functionality by supporting scatter/gather transfers

vchiq

Role: Kernel to VideoCore communication interface
BCM2708: vchiq
Hack: vchiq

sdhci-bcm2708

Role: MMC driver
BCM2708: sdhci-bcm2708
BCM2835: sdhci-bcm2835

My brief testing of sdhci-bcm2835, gave write speeds around 700 kB/s. (notro)

sdhci-bcm2708 uses DMA.

Upstream sdhci-bcm2835 is limited to PIO mode. There is no inherent support for using "platform DMA" to perform block transfers. To implement DMA mode in the upstream version, a mmc-layer driver needs to be created (several other platforms have this and use DMA in a similar fashion) mmc-bcm2835 work underway. Depends on slave_sg support in bcm2835-dmaengine.

  • Internally we have implemented an mmc-bcm2835 driver. This seems to be the preferred method of implementing drivers for hardware that have varying (read: broken) implementations of the SD specification. The driver is working well with performance substantially superior to PIO mode, though it hasn't had the 2 years of testing that the bcm2708 driver has. To be submitted to the kernel mailing lists. (P33M)

bcm2835-mmc added: MMC: added alternative MMC driver

bcm2708_gpio

Role: GPIO driver
BCM2708: bcm2708_gpio
BCM2835: pinctrl-bcm2835

bcm2708_fb

Role: Framebuffer driver
BCM2708: bcm2708_fb
BCM2835:

bcm2708_fb uses DMA. To implement on mach-bcm2835, slave_sg support (also possibly DMA memcpy) required in bcm2835-dmaengine.

  • With the updates to bcm2835-dmaengine, bcm2835-fb has a dependency only on the mailbox interface. (P33M)

bcm2708_wdog

Role: Watchdog driver
BCM2708: bcm2708_wdog
BCM2835: bcm2835_wdt

bcm2708-rng

Role: Random Number Generator driver
BCM2708: bcm2708-rng
BCM2835: bcm2835-rng

bcm2835_hwmon

Role: Hardware Monitoring
BCM2708: bcm2835_hwmon

Adding DT support is trivial.

Dependency on an upstreamed mailbox interface (P33M).

bcm2835_thermal

Role: Thermal Management
BCM2708: bcm2835_thermal
BCM2835:
WIP: bcm2835-thermal

Adding DT support is trivial.

Dependency on an upstreamed mailbox interface (P33M).

bcm2835_AUD[0-7]

Role: Audio
BCM2708: sound/arm/bcm2835.c
Hack: bcm2835-audio

Adding DT support is trivial.

Dependency on an upstreamed mailbox interface (and vchiq) (P33M).

bcm2708-i2s

Role: Audio I2S module
BCM2708: bcm2708-i2s
BCM2835: bcm2835-i2s

snd-hifiberry-dac

Role: Audio
BCM2708: hifiberry_dac

Also adds device: pcm5102a-codec

Not a device associated with the platform. Can be added to the DT if attached (P33M).

snd-hifiberry-digi

Role: Audio BCM2708: hifiberry_digi

Has this as well in bcm2708.c

I2C_BOARD_INFO("wm8804", 0x3b)

Not a device associated with the platform. Can be added to the DT if attached (P33M).

snd-rpi-dac

Role: Audio
BCM2708: rpi-dac

Also adds device: pcm1794a-codec

Not a device associated with the platform. Can be added to the DT if attached (P33M).

snd-rpi-iqaudio-dac

Role: Audio
BCM2708: iqaudio-dac

Has this as well in bcm2708.c

I2C_BOARD_INFO("pcm5122", 0x4c)

Other devices in bcm2708.c

Source: arch/arm/mach-bcm2708/bcm2708.c

1-wire

Driver: w1-gpio
Device Tree: yes (bindings)

Using bcmrpi_defconfig, a w1_device is added on GPIO4 with no pullup enable pin.

Module parameters:

module_param(w1_gpio_pin, uint, 0644);
module_param(w1_gpio_pullup, uint, 0644);

UART0

Role: Serial console
Device: dev:f1
Device Tree: yes (see bcm2835.dtsi)

Module parameter:

module_param(uart_clock, uint, 0644);

UART1

Device: serial8250
Driver: 8250

bcmrpi_defconfig doesn't include CONFIG_SERIAL_8250

leds

Driver: leds-gpio
Device Tree: yes (see bcm2835-rpi-b.dts)

ACT led
Trigger: mmc0

Module parameters:

module_param(disk_led_gpio, uint, 0644);
module_param(disk_led_active_low, uint, 0644);

Revision & Serial

Module parameters:

module_param(boardrev, uint, 0644);
module_param(serial, uint, 0644);
$ cat /proc/cpuinfo
Revision        : 000e
Serial          : 000000004939788f

reboot_part

Used on poweroff to tell the bootloader to halt.

Module parameter:

module_param(reboot_part, uint, 0644);
Clone this wiki locally