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

ARCH_BCM2835 closing in on ARCH_BCM270X #1001

Merged
merged 5 commits into from
Jun 3, 2015

Conversation

notro
Copy link
Contributor

@notro notro commented Jun 3, 2015

This PR attempts to close the gap between ARCH_BCM270X and ARCH_BCM2835 when it comes to functionality and drivers.
bcm2835_defconfig should now be similar to bcmrpi_defconfig (except dwc_otg and lirc_rpi).
DT overlays and parameters need testing.

Known issues

Halt
Halt/poweroff results in reboot. I will take the patch to fix this upstream first.

vchiq
vchiq works partially. Onboard sound, which relies on vchiq, works when using speaker-test, but omxplayer hangs.
vchiq_test does not produce any output:

$ vchiq_test -p
Ping test - service:echo, iters:1000, version 3
^C

dwc_otg
Because irq-bcm2835 lacks FIQ support, dwc_otg/ doesn't work on ARCH_BCM2835. The mainline dwc2 driver is used.

lirc_rpi
lirc_rpi fails to build: missing bcm2708_gpio_setpull().

notro added 5 commits June 3, 2015 12:26
The VideoCore bootloader passes in Serial number and
Revision number through Device Tree. Make these available to
userspace through /proc/cpuinfo.

Mainline status:

There is a commit in linux-next that standardize passing the serial
number through Device Tree (string: /serial-number):
ARM: 8355/1: arch: Show the serial number from devicetree in cpuinfo

There was an attempt to do the same with the revision number, but it
didn't get in:
[PATCH v2 1/2] arm: devtree: Set system_rev from DT revision

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Build Device Tree overlays on ARCH_BCM2835.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Change kconfig dependency to make SND_BCM2708_SOC_* and
VIDEO_BCM2835 available on ARCH_BCM2835.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
These commands where used to make this commit:

./scripts/diffconfig -m arch/arm/configs/bcm2835_defconfig arch/arm/configs/bcmrpi_defconfig > merge.cfg

cat << EOF > filter
CONFIG_ARCH_BCM2708
CONFIG_BCM2708_DT
CONFIG_ARM_PATCH_PHYS_VIRT
CONFIG_PHYS_OFFSET
CONFIG_CMDLINE
CONFIG_BCM2708_WDT
CONFIG_HW_RANDOM_BCM2708
CONFIG_I2C_BCM2708
CONFIG_SPI_BCM2708
CONFIG_SND_BCM2708_SOC_I2S
CONFIG_USB_DWCOTG
CONFIG_LIRC_RPI
EOF

grep -F -v -f filter merge.cfg > filtered.cfg

cat << EOF > added.cfg
CONFIG_WATCHDOG=y
CONFIG_BCM2835_WDT=y
CONFIG_MISC_FILESYSTEMS=y
CONFIG_SND_BCM2835_SOC_I2S=m
EOF

ARCH=arm scripts/kconfig/merge_config.sh arch/arm/configs/bcm2835_defconfig filtered.cfg added.cfg
ARCH=arm make oldconfig

ARCH=arm make savedefconfig
cp defconfig arch/arm/configs/bcm2835_defconfig

rm merge.cfg filter filtered.cfg added.cfg defconfig

ARCH=arm make bcm2835_defconfig
ARCH=arm make oldconfig

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
@pelwell
Copy link
Contributor

pelwell commented Jun 3, 2015

No objections.

@notro
Copy link
Contributor Author

notro commented Jun 3, 2015

I see that 'git commit' took away my comments in bcm2835: Merge bcm2835_defconfig with bcmrpi_defconfig, so I repost it here. Not terribly important, but anyway:

# Get changed and new config values from a merge
./scripts/diffconfig -m arch/arm/configs/bcm2835_defconfig arch/arm/configs/bcmrpi_defconfig > merge.cfg

# Remove these
# USB_DWCOTG needs FIQ which we don't have yet
# LIRC_RPI fails to build
cat << EOF > filter
CONFIG_ARCH_BCM2708
CONFIG_BCM2708_DT
CONFIG_ARM_PATCH_PHYS_VIRT
CONFIG_PHYS_OFFSET
CONFIG_CMDLINE
CONFIG_BCM2708_WDT
CONFIG_HW_RANDOM_BCM2708
CONFIG_I2C_BCM2708
CONFIG_SPI_BCM2708
CONFIG_SND_BCM2708_SOC_I2S
CONFIG_USB_DWCOTG
CONFIG_LIRC_RPI
EOF

# Filter values from the merge
grep -F -v -f filter merge.cfg > filtered.cfg

# Add these
# watchdog is builtin, will later contain restart/poweroff code.
cat << EOF > added.cfg
CONFIG_WATCHDOG=y
CONFIG_BCM2835_WDT=y
CONFIG_MISC_FILESYSTEMS=y
CONFIG_SND_BCM2835_SOC_I2S=m
EOF

# Create new config
ARCH=arm scripts/kconfig/merge_config.sh arch/arm/configs/bcm2835_defconfig filtered.cfg added.cfg
# Verify
ARCH=arm make oldconfig

# Update bcm2835_defconfig
ARCH=arm make savedefconfig
cp defconfig arch/arm/configs/bcm2835_defconfig

# Clean up
rm merge.cfg filter filtered.cfg added.cfg defconfig

# Verify
ARCH=arm make bcm2835_defconfig
ARCH=arm make oldconfig

popcornmix added a commit that referenced this pull request Jun 3, 2015
ARCH_BCM2835 closing in on ARCH_BCM270X
@popcornmix popcornmix merged commit a994129 into raspberrypi:rpi-4.0.y Jun 3, 2015
@notro notro deleted the closer branch June 3, 2015 16:13
@pelwell
Copy link
Contributor

pelwell commented Jun 4, 2015

@notro Can you try this (https://gist.github.com/pelwell/b42fa101f209edfd6fbb) patch and see if it fixes your VCHIQ problem. I've tested omxplayer on a BCM2835 build, and on Pi 1 and Pi 2 with and without DT so it should be OK.

There is some remaining issue (probably a race condition) with vchiq_test -p that causes it to stall on the first few runs, but if you Ctrl-C and repeat it will eventually run, but that's a battle for another day.

@notro
Copy link
Contributor Author

notro commented Jun 4, 2015

Tried it on ARCH_BCM2835 and omxplayer works now. vchiq_test needs 3-4 tries to get going.

@pelwell
Copy link
Contributor

pelwell commented Jun 4, 2015

I found that the same is true on 270x builds as well. I'll push this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants