Home | History | Annotate | Download | only in broadcom
History log of /src/sys/arch/arm/broadcom/bcm2835_emmc.c
RevisionDateAuthorComments
 1.44  25-Sep-2025  jmcneill bcm283x: add SDHC_FLAG_NO_PWR0 quirk

Add SDHC_FLAG_NO_PWR0 quirk to restore previous behaviour with
SDHC_FLAG_32BIT_ACCESS flag.
 1.43  29-Jan-2021  skrll fdtbus_intr_establish -> fdtbus_intr_establish_xname
 1.42  27-Jan-2021  thorpej Rename of_match_compat_data() to of_compatible_match(). Similarly,
rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
 1.41  25-Jan-2021  thorpej Since we're using designated initialisers for compat data, we should
use a completely empty initializer for the sentinel.
 1.40  18-Jan-2021  thorpej Remove "struct of_compat_data" and replace its usage with
"struct device_compatible_entry"; they are ABI-compatible.

Fix several "loses const qualifier" bugs encountered during
this conversion.
 1.39  01-Dec-2020  rin Data written to bcmdmac(4) should be in little-endian.
 1.38  28-Aug-2020  skrll branches: 1.38.2;
Fix build if NBCMDMAC is zero
 1.37  31-May-2020  thorpej Remove superfluous checking for a "disable" property in the device_t
properties dictionary.
 1.36  20-Feb-2020  jmcneill Add support for brcm,bcm2711-emmc2
 1.35  30-Dec-2019  skrll branches: 1.35.2;
Oops, don't match brcm,bcm2711-emmc2 here.

Thanks to jmcneill for pointing out my mistake
 1.34  30-Dec-2019  skrll Match brcm,bcm2711-emmc2
 1.33  19-Aug-2018  rin Clean up leftover when converting intr_establish() to fdtbus_intr_establish().
The latter accept only flags 0 or FDT_INTR_MPSAFE. For both cases, it add
IST_LEVEL flag for underlying intr_establish() function.

OK skrll
 1.32  10-Dec-2017  skrll branches: 1.32.2; 1.32.4;
FDTise RapberryPI support. Thanks for jmcneill for a lot of help with this.

The kernel image that the RPI firmware boots is now netbsd.img in the
kernel build directory.

XXX fdtbus_get_reg needs reworking
 1.31  30-Jul-2017  jmcneill Add driver for the bcm2835 internal SD controller. On boards with SDIO
Wi-Fi, the internal SD controller is used for the SD card slot and the
Arasan SDHCI controller is used for SDIO.
 1.30  22-Jun-2017  jmcneill Disable SDR50 support, it is not reliable on these boards.
 1.29  02-Feb-2016  skrll branches: 1.29.10;
Fix up bcm283[56] bus_space(4) to really use bus addresses for
peripherals, etc

Simplifies the code in various places and uses the abstraction in
more places. (bcm2835_gpio_subr.c still doesn't)
 1.28  09-Aug-2015  mlelstv Invoke callback routine for all DMA interrupts.
Pass status and error bits to callback instead of filtering them early.
Adjust the current only callback routine in the EMMC driver.
 1.27  09-Aug-2015  mlelstv Handle error when setting DMA transfer.
 1.26  03-Aug-2015  jmcneill DDR50 and SDR104 don't seem to be stable here, so disable them
 1.25  02-Aug-2015  jmcneill enable UHS support
 1.24  31-Jul-2015  jmcneill Simplify sdhc(4) locking
 1.23  29-Jul-2015  skrll When expanding an inline function make sure you get the argument order
correct!

Now there's no functional change to expanding bcm2835_intr_establish
 1.22  29-Jul-2015  skrll Expand the bcm2835_intr_establish inline.

No functional change.
 1.21  15-Dec-2014  mlelstv Don't pipeline any DMA writes to eMMC.

Fixes PR/49463.
 1.20  25-Nov-2014  skrll branches: 1.20.2;
Only use 128-bit mode when the transfer is a multiple of this.

From Jared (the arm periph guy)
 1.19  04-Oct-2014  jmcneill vendor_transfer_data_dma callback takes a struct sdhc_softc now
 1.18  01-Oct-2014  jmcneill SDHC_MAX_BLK_LEN_1024 needs to be shifted into caps reg
 1.17  01-Oct-2014  jmcneill oops, SDHC_FLAG_NO_HS_BIT is still required
 1.16  01-Oct-2014  jmcneill SDHC_FLAG_NO_HS_BIT should no longer be needed
 1.15  13-Sep-2014  skrll Fix typo in previous
 1.14  13-Sep-2014  skrll Make emmc use of dma controller optional and disable the bcmdmac for now.

It doesn't work for me.
 1.13  12-Sep-2014  jmcneill cv_wait -> cv_timedwait for dma transfers, just to be safe
 1.12  12-Sep-2014  jmcneill use 0 and 1 for states instead of 27 and 42
 1.11  12-Sep-2014  jakllsch Add and enable DMA support for SD cards on Raspberry Pi/BCM2835.
 1.10  10-Sep-2014  jakllsch Drop unused local-softc variable.
 1.9  05-Sep-2013  skrll branches: 1.9.4;
Whitespace
 1.8  14-Apr-2013  skrll branches: 1.8.4;
Trailing whitespace
 1.7  10-Jan-2013  jmcneill reinstate SDHC_HIGH_SPEED_SUPP capability, and add SDHC_FLAG_NO_HS_BIT flag to workaround bcm2835 sdhc issue with many high speed cards
 1.6  10-Jan-2013  jmcneill Don't set SDHC_HIGH_SPEED_SUPP in host caps as many cards stop responding
after the switch to high speed mode.
 1.5  07-Jan-2013  jmcneill emmc supports 1k block size, so set SDHC_MAX_BLK_LEN_1024 in host caps
 1.4  23-Dec-2012  jakllsch The BCM2835 reference says the SDHC_HIGH_SPEED bit in SDHC_HOST_CTL is
implemented, so add SDHC_HIGH_SPEED_SUPP to the software-implemented
SDHC_CAPABILITIES register.
 1.3  30-Oct-2012  skrll Whitespace. *sigh*
 1.2  30-Oct-2012  skrll Query the EMMC clock rate and use it if it's available.
 1.1  26-Jul-2012  skrll branches: 1.1.2; 1.1.4; 1.1.6;
Initial commit of support for the RaspberryPI (www.raspberrypi.org)

This is enough for serial console via the gpio header pins and to get to
multiuser.

A huge thank you to Matt Thomas for all his help.
 1.1.6.5  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.4  23-Jan-2013  yamt sync with head
 1.1.6.3  16-Jan-2013  yamt sync with (a bit old) head
 1.1.6.2  30-Oct-2012  yamt sync with head
 1.1.6.1  26-Jul-2012  yamt file bcm2835_emmc.c was added on branch yamt-pagecache on 2012-10-30 17:18:58 +0000
 1.1.4.5  03-Dec-2017  jdolecek update from HEAD
 1.1.4.4  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.3  23-Jun-2013  tls resync from head
 1.1.4.2  25-Feb-2013  tls resync with head
 1.1.4.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.4  13-Feb-2013  riz Pull up following revision(s) (requested by skrll in ticket #813):

etc/MAKEDEV.tmpl 1.160
etc/etc.evbarm/MAKEDEV.conf 1.9
external/broadcom/rpi-firmware/dist/LICENCE.broadcom 1.1
external/broadcom/rpi-firmware/dist/bootcode.bin 1.1
external/broadcom/rpi-firmware/dist/bootcode.bin 1.2
external/broadcom/rpi-firmware/dist/fixup.dat 1.1
external/broadcom/rpi-firmware/dist/fixup.dat 1.2
external/broadcom/rpi-firmware/dist/fixup_cd.dat 1.1
external/broadcom/rpi-firmware/dist/fixup_cd.dat 1.2
external/broadcom/rpi-firmware/dist/start.elf 1.1
external/broadcom/rpi-firmware/dist/start.elf 1.2
external/broadcom/rpi-firmware/dist/start_cd.elf 1.1
external/broadcom/rpi-firmware/dist/start_cd.elf 1.2
sys/arch/arm/broadcom/bcm2835_bsc.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_bscreg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_dotg.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_emmc.c 1.7 via patch
sys/arch/arm/broadcom/bcm2835_genfb.c 1.4 via patch
sys/arch/arm/broadcom/bcm2835_gpio_subr.c 1.2 via patch
sys/arch/arm/broadcom/bcm2835_gpio_subr.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_gpioreg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_intr.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835_mbox.c 1.5 via patch
sys/arch/arm/broadcom/bcm2835_mbox.h 1.4 via patch
sys/arch/arm/broadcom/bcm2835_obio.c 1.17 via patch
sys/arch/arm/broadcom/bcm2835_pm.c 1.2 via patch
sys/arch/arm/broadcom/bcm2835_rng.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835_space.c 1.5 via patch
sys/arch/arm/broadcom/bcm2835_spi.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_spireg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_tmr.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835reg.h 1.10 via patch
sys/arch/arm/broadcom/files.bcm2835 1.14 via patch
sys/arch/evbarm/conf/RPI 1.23 via patch
sys/arch/evbarm/conf/files.rpi 1.3 via patch
sys/arch/evbarm/conf/mk.rpi 1.2 via patch
sys/arch/evbarm/conf/std.rpi 1.4 via patch
sys/arch/evbarm/rpi/rpi_machdep.c 1.34 via patch
sys/arch/evbarm/rpi/rpi_start.S 1.7 via patch
sys/arch/evbarm/rpi/rpi_vcmbox.c 1.2 via patch
sys/arch/evbarm/rpi/vcio.h 1.1 via patch
sys/arch/evbarm/rpi/vcprop.h 1.7 via patch
sys/conf/files patch
sys/dev/sdmmc/sdhc.c 1.43
sys/dev/sdmmc/sdhcvar.h 1.13
sys/dev/usb/dwc_otg.c 1.45 via patch
sys/dev/usb/dwc_otgreg.h 1.5 via patch
sys/dev/usb/dwc_otgvar.h 1.11 via patch
sys/dev/usb/files.usb 1.126 via patch
sys/dev/usb/if_smsc.c 1.7 via patch
sys/dev/usb/if_smscreg.h 1.1 via patch
sys/dev/usb/if_smscvar.h 1.1 via patch
sys/dev/usb/usbdevices.config patch
sys/dev/usb/usbdevs 1.633 via patch
sys/dev/usb/usbdevs.h regen
sys/dev/usb/usbdevs_data.h regen
sys/dev/wscons/wsconsio.h 1.105,1.107 via patch
sys/dev/wscons/wsdisplayvar.h 1.50
sys/dev/wscons/wsdisplay_util.c 1.2
sys/dev/videomode/edid.c 1.12 via patch

Greatly improved Raspberry Pi support. USB and onboard
Ethernet should work.
[skrll, ticket #813]
 1.1.2.3  19-Nov-2012  riz sys/arch/arm/broadcom/bcm2835_emmc.c patch
sys/arch/arm/broadcom/bcm2835reg.h patch
sys/arch/arm/broadcom/bcm2835_mbox.h 1.1-1.3 via patch
sys/arch/arm/broadcom/bcm2835_mbox_subr.c 1.1-1.3 via patch
sys/arch/arm/broadcom/bcm2835_mboxreg.h 1.1 via patch
sys/arch/arm/broadcom/files.bcm2835 patch
sys/arch/evbarm/rpi/rpi_machdep.c patch
sys/arch/evbarm/rpi/rpi_start.S patch
sys/arch/evbarm/rpi/vcio.h 1.1 via patch
sys/arch/evbarm/rpi/vcprop.h 1.1-1.2 via patch

Improve Raspberry PI support: memory layout and clock for the
sdhc(4) controller are queried via the mailbox properties
channel.
[skrll, ticket #660]
 1.1.2.2  09-Aug-2012  jdc Pull up revisions:
src/sys/arch/evbarm/dev/plcomreg.h revisions 1.2,1.3,1.4
src/sys/arch/evbarm/conf/INTEGRATOR revision 1.65
src/sys/arch/evbarm/dev/plcom.c revisions 1.34,1.35,1.36,1.37,1.38,1.39,1.40
src/sys/arch/evbarm/ifpga/plcom_ifpga.c revisions 1.12,1.13,1.14
src/sys/arch/evbarm/dev/plcomvar.h revisions 1.9,1.10,1.11
src/sys/arch/evbarm/ifpga/plcom_ifpgavar.h revision 1.2
src/sys/arch/arm/arm/cpufunc.c revisions 1.105,1.108
src/sys/arch/arm/arm32/cpu.c revision 1.79
src/sys/arch/arm/include/armreg.h revisions 1.49,1.54
src/sys/arch/arm/arm32/pmap.c revision 1.229
src/sys/arch/arm/arm32/arm32_machdep.c revision 1.77
src/sys/arch/arm/include/cpu.h revision 1.64
src/sys/arch/arm/arm/cpufunc_asm_arm1136.S revision 1.3
src/sys/arch/arm/arm/cpufunc_asm_arm11x6.S revision 1.1
src/sys/arch/arm/conf/files.arm revision 1.106
src/sys/arch/arm/include/cpufunc.h revision 1.57
src/sys/dev/sdmmc/sdhc.c revisions 1.14,1.24
src/sys/dev/sdmmc/sdhcvar.h revisions 1.7,1.8
src/sys/arch/evbarm/ifpga/ifpgareg.h revision 1.4
src/sys/arch/evbarm/integrator/integrator_machdep.c revision 1.69
src/sys/arch/arm/broadcom/bcm2835_dma.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_emmc.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_intr.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_intr.h revision 1.1
src/sys/arch/arm/broadcom/bcm2835_obio.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_plcom.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_pm.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_pmvar.h revision 1.1
src/sys/arch/arm/broadcom/bcm2835_space.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835_tmr.c revision 1.1
src/sys/arch/arm/broadcom/bcm2835reg.h revision 1.1
src/sys/arch/arm/broadcom/bcm2835var.h revision 1.1
src/sys/arch/arm/broadcom/bcm_amba.h revision 1.1
src/sys/arch/arm/broadcom/files.bcm2835 revision 1.1
src/sys/arch/evbarm/Makefile revision 1.9
src/sys/arch/evbarm/conf/RPI revision 1.1
src/sys/arch/evbarm/conf/files.rpi revision 1.1
src/sys/arch/evbarm/conf/mk.rpi revision 1.1
src/sys/arch/evbarm/conf/std.rpi revision 1.1
src/sys/arch/evbarm/rpi/genassym.cf revision 1.1
src/sys/arch/evbarm/rpi/rpi.h revision 1.1
src/sys/arch/evbarm/rpi/rpi_machdep.c revision 1.1
src/sys/arch/evbarm/rpi/rpi_start.S revision 1.1,1.2
src/etc/etc.evbarm/Makefile.inc revision 1.28
(requested by skrll in ticket #454).

don't mix #define<TAB> and #define<SPACE> in a file.

avoid warning with options PLCOM_DEBUG for INTEGRATOR.

Rename register values. No functional change - same code before and after.

Existing names are prefixed with PL01X_ where they're common between the
PL010 and the PL011. The PL010_/PL011_ prefixes are added where they're
found only on the respective chips.

Replace the simple_lock with a kmutex_t. Update the locking to match
com(4) in the few places it didn't already.

DOH. Replace a line that got accidently deleted in the last commit.

device_t/softc split
struct device * -> device_t
struct cfdata * -> cfdata_t

Add the 'Z' to the 1176 cpu product name.

ok matt@

Fix locking botch introduced in 1.36.

Fix a KASSERT. From/OK'ed by matt@

Fix racy softint dispatch that lead to KASSERT(si->si_active) in
softint_execute

Discussed with matt@. "Looks good to me"

Add the documented ARM11[37]6 Auxiliary control register defines.

Add support for the ARM1176JZS

Add a flag for the lack of LED_ON in HOST_CTL (ti omap3 doesn't do that).

Provide a method for attachments to specify capabilites.

Add support for the PL011 to plcom. Pull across a bunch of fixes from
com(4) while I'm here and do some other tidyup.

Tested on a RaspberryPi.

PL010 not tested.

Initial commit of support for the RaspberryPI (www.raspberrypi.org)

This is enough for serial console via the gpio header pins and to get to
multiuser.

A huge thank you to Matt Thomas for all his help.

Add RPI to KERNEL_SETS

Remove #if 0 code.
 1.1.2.1  26-Jul-2012  jdc file bcm2835_emmc.c was added on branch netbsd-6 on 2012-08-09 06:36:49 +0000
 1.8.4.1  18-May-2014  rmind sync with head
 1.9.4.5  26-Feb-2016  snj Pull up following revision(s) (requested by skrll in ticket #1107):
external/broadcom/rpi-firmware/dist/LICENCE.broadcom: revision 1.2
external/broadcom/rpi-firmware/dist/bootcode.bin: revision 1.8
external/broadcom/rpi-firmware/dist/fixup.dat: revision 1.8
external/broadcom/rpi-firmware/dist/fixup_cd.dat: revision 1.8
external/broadcom/rpi-firmware/dist/start.elf: revision 1.8
external/broadcom/rpi-firmware/dist/start_cd.elf: revision 1.8
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.29
sys/arch/arm/broadcom/bcm2835_gpio.c: revision 1.3
sys/arch/arm/broadcom/bcm2835_gpio_subr.c: revision 1.4
sys/arch/arm/broadcom/bcm2835_space.c: revision 1.9, 1.10
sys/arch/arm/broadcom/bcm2835reg.h: patch
sys/arch/arm/cortex/a9_mpsubr.S: revisions 1.45, 1.46
sys/arch/evbarm/conf/CUBIEBOARD: revision 1.45
sys/arch/evbarm/conf/std.awin: revision 1.9
sys/arch/evbarm/rpi/rpi2_start.S: revision 1.3
sys/arch/evbarm/rpi/rpi_machdep.c: revision 1.68
Check for hypervisor mode in cortex_init and exit if the cpu started
there.
Needed by latest RPI firmware.
--
Fix up bus_space_map for latest RPI firmware which now passes the FB
address in the mailbox properties as a bus address.
--
Update RPI firmware to version after the following commit
commit 224c75602b8bae1a9e942b4f1c7ed3aa8e0f0ec8
Author: popcornmix<popcornmix@gmail.com>
Date: Tue Dec 8 14:48:57 2015 +0000
--
Deal with kernel builds where virtualisation isn't available
--
Tweak CPUFLAGS to cover all CPUs
--
Fix up bcm283[56] bus_space(4) to really use bus addresses for
peripherals, etc
Simplifies the code in various places and uses the abstraction in
more places. (bcm2835_gpio_subr.c still doesn't)
 1.9.4.4  15-Dec-2014  martin Pull up following revision(s) (requested by mlelstv in ticket #328):
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.21
Don't pipeline any DMA writes to eMMC.
Fixes PR/49463.
 1.9.4.3  25-Nov-2014  martin Pull up following revision(s) (requested by skrll in ticket #265):
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.20
Only use 128-bit mode when the transfer is a multiple of this.
From Jared (the arm periph guy)
 1.9.4.2  05-Oct-2014  martin Pull up following revision(s) (requested by skrll in ticket #129):
sys/dev/sdmmc/sdhcvar.h: revision 1.15
sys/dev/sdmmc/sdhc.c: revision 1.51
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.19
Pass sdhc_softc instead of sdhc_host to sc_vendor_transfer_data_dma,
since the vendor specific code has no access to it otherwise,
but can easily do device_private(sdhc_softc->sc_dev).
 1.9.4.1  03-Oct-2014  martin Pull up following revision(s) (requested by skrll in ticket #126):
sys/arch/evbarm/rpi/rpi_machdep.c: revision 1.47
sys/arch/arm/broadcom/bcm2835reg.h: revision 1.12
sys/arch/evbarm/conf/RPI: revision 1.52
sys/arch/evbarm/conf/RPI: revision 1.53
sys/arch/evbarm/conf/RPI: revision 1.54
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.10
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.11
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.12
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.13
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.14
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.15
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.3
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.4
sys/arch/arm/broadcom/bcm2835_dmac.h: revision 1.2
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.5
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.18
sys/arch/arm/broadcom/bcm2835_dmac.h: revision 1.3
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.6
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.7
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.8
sys/arch/arm/broadcom/bcm2835_dmac.c: revision 1.9
sys/arch/arm/broadcom/files.bcm2835: revision 1.23
sys/dev/sdmmc/sdhc.c: revision 1.45
sys/dev/sdmmc/sdhc.c: revision 1.46
sys/dev/sdmmc/sdhc.c: revision 1.47
sys/dev/sdmmc/sdhcvar.h: revision 1.14
Various RPI DMAC and sdhc improvements.
 1.20.2.4  28-Aug-2017  skrll Sync with HEAD
 1.20.2.3  19-Mar-2016  skrll Sync with HEAD
 1.20.2.2  22-Sep-2015  skrll Sync with HEAD
 1.20.2.1  06-Apr-2015  skrll Sync with HEAD
 1.29.10.1  30-Jun-2017  snj Pull up following revision(s) (requested by jmcneill in ticket #59):
sys/arch/arm/broadcom/bcm2835_emmc.c: revision 1.30
Disable SDR50 support, it is not reliable on these boards.
 1.32.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.32.4.1  10-Jun-2019  christos Sync with HEAD
 1.32.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.35.2.1  29-Feb-2020  ad Sync with head.
 1.38.2.2  03-Apr-2021  thorpej Sync with HEAD.
 1.38.2.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed