diff --git a/projects/RPi/linux/linux.arm.conf b/projects/RPi/linux/linux.arm.conf index 5200a7c740..6b74f7e1bd 100644 --- a/projects/RPi/linux/linux.arm.conf +++ b/projects/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.15.0 Kernel Configuration +# Linux/arm 3.15.5 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -313,6 +313,7 @@ CONFIG_ARCH_BCM2708=y # Broadcom BCM2708 Implementations # CONFIG_MACH_BCM2708=y +# CONFIG_BCM2708_DT is not set CONFIG_BCM2708_GPIO=y CONFIG_BCM2708_VCMEM=y # CONFIG_BCM2708_NOL2CACHE is not set @@ -2736,6 +2737,13 @@ CONFIG_LIRC_XBOX=m # CONFIG_DGAP is not set # CONFIG_GS_FPGABOOT is not set CONFIG_CLKDEV_LOOKUP=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_COMMON_CLK=y + +# +# Common Clock Framework +# +# CONFIG_COMMON_CLK_SI5351 is not set # # Hardware Spinlock drivers diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index a9413406af..ca8cc26f77 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From beaa4adeae6ca9ad09d12d84e41e093291ef7c4b Mon Sep 17 00:00:00 2001 +From e37bf99f8d2de9ff2b179c4f134c9f76d05f6218 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/54] Main bcm2708 linux port +Subject: [PATCH 01/64] Main bcm2708 linux port Signed-off-by: popcornmix --- @@ -8558,7 +8558,7 @@ index 0a3ed01..6857875 100644 extern int sdhci_runtime_suspend_host(struct sdhci_host *host); extern int sdhci_runtime_resume_host(struct sdhci_host *host); diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index dacf0a0..3273cc2 100644 +index c2ee793..3196890 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -84,7 +84,7 @@ struct vendor_data { @@ -8594,10 +8594,10 @@ index 7be12b8..a968bd6 100644 1.9.3 -From ec5fb87c5db9a5bbbe6aaaa3b645ba3a3d3b87bb Mon Sep 17 00:00:00 2001 +From c2895111e4d456b641c80c6b8ed364e6a92015fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 7 May 2013 22:20:24 +0100 -Subject: [PATCH 02/54] Add quick config. +Subject: [PATCH 02/64] Add quick config. This is designed for quick compiling when developing. No modules are needed and it includes all Pi specific drivers @@ -8813,10 +8813,10 @@ index 0000000..e5efe75 1.9.3 -From 80008786c317729eecb00537c1a2a8ebc2e809a2 Mon Sep 17 00:00:00 2001 +From 283b04a18d18b08bcf0eec4384e28e65c01000a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 03/54] Add dwc_otg driver +Subject: [PATCH 03/64] Add dwc_otg driver Signed-off-by: popcornmix --- @@ -65888,10 +65888,10 @@ index 0000000..cdc9963 1.9.3 -From db3ceff1eea2b9c0a96b67b86e4765d301b09875 Mon Sep 17 00:00:00 2001 +From 187820b6662bc8e785f219334c8b915287dbecb5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 04/54] bcm2708 watchdog driver +Subject: [PATCH 04/64] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -66322,10 +66322,10 @@ index 0000000..8a27d68 1.9.3 -From de39ca1ccc039893df6cab59cf8872947c2b1e03 Mon Sep 17 00:00:00 2001 +From fad16f27bf5a63a43c64c728550cff7201a46973 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:55:09 +0100 -Subject: [PATCH 05/54] bcm2708 framebuffer driver +Subject: [PATCH 05/64] bcm2708 framebuffer driver Signed-off-by: popcornmix --- @@ -69372,10 +69372,10 @@ index 3c14e43..7626beb 100644 1.9.3 -From 9bb9779f379fd113719fd4c0fbb986a9894ced14 Mon Sep 17 00:00:00 2001 +From 21372dcbbe88e25280099d9fe1357b9fe60b2cce Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 06/54] bcm2708 vchiq driver +Subject: [PATCH 06/64] bcm2708 vchiq driver Signed-off-by: popcornmix @@ -81927,11 +81927,12 @@ index 0000000..b6bfa21 1.9.3 -From 857366f5cc92ec3ca752e1a1d5e670b4c81b7176 Mon Sep 17 00:00:00 2001 +From 05b0be89dd68c37855d771696f1e6f793cafec92 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 12 May 2014 15:12:02 +0100 -Subject: [PATCH 07/54] vchiq: Avoid high load when blocked and unkillable +Subject: [PATCH 07/64] vchiq: Avoid high load when blocked and unkillable +vchiq: Include SIGSTOP and SIGCONT in list of signals not-masked by vchiq to allow gdb to work --- .../interface/vchiq_arm/vchiq_2835_arm.c | 1 + .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 + @@ -82005,7 +82006,7 @@ index be9735f..5a4182e 100644 diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h new file mode 100644 -index 0000000..505ee1a +index 0000000..335446e --- /dev/null +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h @@ -0,0 +1,69 @@ @@ -82048,7 +82049,7 @@ index 0000000..505ee1a +#include +#include + -+#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT)) ++#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT) | sigmask(SIGTRAP) | sigmask(SIGSTOP) | sigmask(SIGCONT)) + +static inline int __must_check down_interruptible_killable(struct semaphore *sem) +{ @@ -82094,10 +82095,10 @@ index c2eefef..05e7979 100644 1.9.3 -From c402e40f29320bd699be82d1e14247e8e657beab Mon Sep 17 00:00:00 2001 +From 00b02bc17146a7bc97f0a67154956e6a129b3221 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 08/54] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 08/64] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix --- @@ -83389,10 +83390,10 @@ index 0000000..5325832 1.9.3 -From e74ab01f67ba082f94066a5596fd22b20cd21b17 Mon Sep 17 00:00:00 2001 +From 9fb8657030e08cc79d731be06304bdfc976c007a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 09/54] bcm2708: alsa sound driver +Subject: [PATCH 09/64] bcm2708: alsa sound driver Signed-off-by: popcornmix --- @@ -85756,10 +85757,10 @@ index 0000000..af3e6eb 1.9.3 -From 2f7173137d8274100a9b040c6678c610f6cc47bb Mon Sep 17 00:00:00 2001 +From 4fbf6266e01c0f8b65fc9fc1129d3829bd510460 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Apr 2013 10:08:31 -0700 -Subject: [PATCH 10/54] alsa: add mmap support and some cleanups to bcm2835 +Subject: [PATCH 10/64] alsa: add mmap support and some cleanups to bcm2835 ALSA driver --- @@ -86239,17 +86240,17 @@ index 080bd5c..36afee3 100755 1.9.3 -From d6a322aaf67b98d3dca2db19a17deaa3b241a7b9 Mon Sep 17 00:00:00 2001 +From 396aa2537f80f72e916800ac9bf4395ffe63a3aa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 11/54] Add hwrng (hardware random number generator) driver +Subject: [PATCH 11/64] Add hwrng (hardware random number generator) driver --- arch/arm/mach-bcm2708/include/mach/platform.h | 1 + drivers/char/hw_random/Kconfig | 11 +++ drivers/char/hw_random/Makefile | 1 + - drivers/char/hw_random/bcm2708-rng.c | 117 ++++++++++++++++++++++++++ - 4 files changed, 130 insertions(+) + drivers/char/hw_random/bcm2708-rng.c | 118 ++++++++++++++++++++++++++ + 4 files changed, 131 insertions(+) create mode 100755 drivers/char/hw_random/bcm2708-rng.c diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h @@ -86298,10 +86299,10 @@ index 3ae7755..a7bfb80 100644 obj-$(CONFIG_HW_RANDOM_MSM) += msm-rng.o diff --git a/drivers/char/hw_random/bcm2708-rng.c b/drivers/char/hw_random/bcm2708-rng.c new file mode 100755 -index 0000000..1ffa7d7 +index 0000000..340f004 --- /dev/null +++ b/drivers/char/hw_random/bcm2708-rng.c -@@ -0,0 +1,117 @@ +@@ -0,0 +1,118 @@ +/** + * Copyright (c) 2010-2012 Broadcom. All rights reserved. + * @@ -86390,15 +86391,16 @@ index 0000000..1ffa7d7 + return -ENOMEM; + } + bcm2708_rng_ops.priv = (unsigned long)rng_base; ++ ++ /* set warm-up count & enable */ ++ __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); ++ __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); ++ + /* register driver */ + err = hwrng_register(&bcm2708_rng_ops); + if (err) { + pr_err("bcm2708_rng_init hwrng_register()=%d\n", err); + iounmap(rng_base); -+ } else { -+ /* set warm-up count & enable */ -+ __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); -+ __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); + } + return err; +} @@ -86423,10 +86425,10 @@ index 0000000..1ffa7d7 1.9.3 -From 59bab50a0d0bf034729f91dab58fee0477c8eca3 Mon Sep 17 00:00:00 2001 +From 5ccb2f9660f478fde39f4142e0eb3e7f3142f816 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 12/54] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 12/64] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -87171,10 +87173,10 @@ index 0000000..57ffacf 1.9.3 -From 208e15e122803c08eaf86d1e4168e9168a7e899a Mon Sep 17 00:00:00 2001 +From 2c66ed53ee696fa94b26925ed847baba3bca9641 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 May 2012 23:12:13 +0100 -Subject: [PATCH 13/54] Fixes for sdhci-bcm2708 +Subject: [PATCH 13/64] Fixes for sdhci-bcm2708 possible fix for sdcard missing status. Thank naren @@ -88448,10 +88450,10 @@ index a968bd6..df54b9b 100644 1.9.3 -From 9756a21a0528a2bb043bb7b890e87fde53dfea79 Mon Sep 17 00:00:00 2001 +From 56176302aac5a8f165bce1b2451c1b3bb5b86f46 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 14/54] Add cpufreq driver +Subject: [PATCH 14/64] Add cpufreq driver --- arch/arm/Kconfig | 1 + @@ -88753,10 +88755,10 @@ index 0000000..7bc55bd 1.9.3 -From 1f4501eacf46c40733466d8fb7a4b0141c1f7ecc Mon Sep 17 00:00:00 2001 +From 278de38eaccb432992e4cd33a2c641ddd0163187 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 15/54] Added hwmon/thermal driver for reporting core +Subject: [PATCH 15/64] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian --- @@ -89281,10 +89283,10 @@ index 0000000..85fceb5 1.9.3 -From c8b39ce4f92fa3ba3b09d15879e72a6d8c1ed9a2 Mon Sep 17 00:00:00 2001 +From fc3526e11aa4220ebd89ef2e2d3033c8b3c2cb17 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 16/54] Allow mac address to be set in smsc95xx +Subject: [PATCH 16/64] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -89378,10 +89380,10 @@ index 424db65e..fc1ef4e 100644 1.9.3 -From c89f782e90fc5013849d45cb41054eeaaca1c56c Mon Sep 17 00:00:00 2001 +From 0edea5edb123d899961a2f9c7fa5de53e2df6022 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 4 Nov 2013 18:56:10 +0000 -Subject: [PATCH 17/54] Add Chris Boot's i2c and spi drivers. +Subject: [PATCH 17/64] Add Chris Boot's i2c and spi drivers. i2c-bcm2708: fixed baudrate @@ -90765,10 +90767,10 @@ index 0000000..06dd02f 1.9.3 -From 387c7a0d0e903504c3393216c9cd29035af37272 Mon Sep 17 00:00:00 2001 +From 7779b109af8fc7c051118a631086e56da449f795 Mon Sep 17 00:00:00 2001 From: cbeytas Date: Mon, 24 Jun 2013 00:05:40 -0400 -Subject: [PATCH 18/54] Perform I2C combined transactions when possible +Subject: [PATCH 18/64] Perform I2C combined transactions when possible Perform I2C combined transactions whenever possible, within the restrictions of the Broadcomm Serial Controller. @@ -90843,10 +90845,10 @@ index f266f10..8750634 100644 1.9.3 -From 37afb4bff4b8b31eddfa28cfd49a6bd45dacf723 Mon Sep 17 00:00:00 2001 +From 12d19988b97d88cba14bbef1a0549658f120d79d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 19/54] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 19/64] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -91063,7 +91065,7 @@ index 734dab7..a3a64d8 100644 u8, w1_slave_found_callback); }; diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c -index 9b084db..5c20492 100644 +index 728039d2..b68c179 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c @@ -124,6 +124,20 @@ int w1_add_master_device(struct w1_bus_master *master) @@ -91121,10 +91123,10 @@ index 2820924..fd0550f 100644 1.9.3 -From d72219d3950210d8b498d78c9840bb97db504052 Mon Sep 17 00:00:00 2001 +From 21e6e49ac20d67a469bfa8848ebc8119e8c2377b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:58:47 +0100 -Subject: [PATCH 23/54] config: add missing options from 3.6.y kernel +Subject: [PATCH 23/64] config: add missing options from 3.6.y kernel --- arch/arm/configs/bcmrpi_defconfig | 755 ++++++++++++++++++++++++++++++++------ @@ -92174,10 +92176,10 @@ index 31f5afaa..78d789c 100644 1.9.3 -From 4c248291b0bf90de3eabc221912f7f865a64d0c6 Mon Sep 17 00:00:00 2001 +From 0f34d6fd8de08920c3048899334fca524b3967e1 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 24/54] Speed up console framebuffer imageblit function +Subject: [PATCH 24/64] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -92389,10 +92391,10 @@ index a2bb276..436494f 100644 1.9.3 -From 81f1e729fa271a57a4819630a36baca3cb354402 Mon Sep 17 00:00:00 2001 +From 8b16ab4a36aa8017c61a8cd32d26577e3bc7289d Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 25/54] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 25/64] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -92488,10 +92490,10 @@ index fb795c3..fa72af0 100644 1.9.3 -From 42863cf4409f763fcb9c1d48b631c80bf7cdaff3 Mon Sep 17 00:00:00 2001 +From d6fe90f30c75df3e38c36d895de95038c1439cf7 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 16:00:25 +0300 -Subject: [PATCH 26/54] bcm2708_fb: DMA acceleration for fb_copyarea +Subject: [PATCH 26/64] bcm2708_fb: DMA acceleration for fb_copyarea Based on http://www.raspberrypi.org/phpBB3/viewtopic.php?p=62425#p62425 Also used Simon's dmaer_master module as a reference for tweaking DMA @@ -92949,10 +92951,10 @@ index 54cd760..798eb52 100644 1.9.3 -From 7ba7c386c71c076422e25dcbebfa5fc78cc537ad Mon Sep 17 00:00:00 2001 +From ae63a6fb5500f30dcdf77d807ea15213c8cefe7b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 27/54] config: Enable CONFIG_MEMCG, but leave it disabled (due +Subject: [PATCH 27/64] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -93008,10 +93010,10 @@ index ceee0c5..39a172b 100644 * css_tryget_from_dir - get corresponding css from the dentry of a cgroup dir * @dentry: directory dentry of interest diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 5177c6d..4046101 100644 +index 67c927a..6512641 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -7157,6 +7157,7 @@ struct cgroup_subsys memory_cgrp_subsys = { +@@ -7158,6 +7158,7 @@ struct cgroup_subsys memory_cgrp_subsys = { .bind = mem_cgroup_bind, .base_cftypes = mem_cgroup_files, .early_init = 0, @@ -93023,10 +93025,10 @@ index 5177c6d..4046101 100644 1.9.3 -From ab265aa593f961b282b0be33b3eacd8aaf7c3e0b Mon Sep 17 00:00:00 2001 +From 7beda6ed6312bbd470bb342040623be4e44f7d94 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:46:42 +0100 -Subject: [PATCH 28/54] Add FIQ patch to dwc_otg driver. Enable with +Subject: [PATCH 28/64] Add FIQ patch to dwc_otg driver. Enable with dwc_otg.fiq_fix_enable=1. Should give about 10% more ARM performance. Thanks to Gordon and Costas @@ -96348,10 +96350,10 @@ index 1b1f83c..c8590b5 100644 1.9.3 -From 664dcd42c98f7a75ea6d018907e1998e2771607e Mon Sep 17 00:00:00 2001 +From dfa32d4a5af731c1a41cd850fa959b718b11dbd4 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 19 Mar 2014 12:58:23 +0000 -Subject: [PATCH 29/54] dwc_otg: fiq_fsm: Base commit for driver rewrite +Subject: [PATCH 29/64] dwc_otg: fiq_fsm: Base commit for driver rewrite This commit removes the previous FIQ fixes entirely and adds fiq_fsm. @@ -101250,10 +101252,10 @@ index 5d310df..4b32941 100644 1.9.3 -From 620645ee3853eae6b4f515716c5777bf55f5550d Mon Sep 17 00:00:00 2001 +From 2b260a7e8a29853dd243e7d6d037f7ad4f6bb69e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 30/54] bcm2835: add v4l2 camera device +Subject: [PATCH 30/64] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -107241,10 +107243,10 @@ index 0000000..9d1d11e 1.9.3 -From 6870151c2b0273977e9b932eb6afb9986f442a1e Mon Sep 17 00:00:00 2001 +From a07a86bb9923797cc2229f8a53fdfa6e1d2b8395 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 9 Dec 2013 10:58:01 +0000 -Subject: [PATCH 31/54] V4L2: Fixes from 6by9 +Subject: [PATCH 31/64] V4L2: Fixes from 6by9 V4L2: Fix EV values. Add manual shutter speed control @@ -109619,10 +109621,10 @@ index a06fb44..76f249e 100644 1.9.3 -From 31b6cfc869189aabbaf9e14e3f81a685ce175e33 Mon Sep 17 00:00:00 2001 +From fd0cd901b1f4d3c502c2a0fbd0cdf905b17676a4 Mon Sep 17 00:00:00 2001 From: Julian Scheel Date: Wed, 19 Feb 2014 16:06:59 +0100 -Subject: [PATCH 32/54] snd-bcm2835: Add support for spdif/hdmi passthrough +Subject: [PATCH 32/64] snd-bcm2835: Add support for spdif/hdmi passthrough This adds a dedicated subdevice which can be used for passthrough of non-audio formats (ie encoded a52) through the hdmi audio link. In addition to this @@ -110093,10 +110095,10 @@ index 36afee3..8c2fe26 100755 1.9.3 -From f016071b3e7716c3aec59024153e8f1462d06b27 Mon Sep 17 00:00:00 2001 +From 65f59cdf17e27195c0f1182064eedb4158d8b392 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 33/54] dmaengine: Add support for BCM2708 +Subject: [PATCH 33/64] dmaengine: Add support for BCM2708 Add support for DMA controller of BCM2708 as used in the Raspberry Pi. Currently it only supports cyclic DMA. @@ -110736,10 +110738,10 @@ index 0000000..b244293 1.9.3 -From 41eea6063f1e492bd8f7a04a588405c72afede7a Mon Sep 17 00:00:00 2001 +From 025192f091d11ce772b76a0780f3f04808f5098b Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 34/54] ASoC: Add support for BCM2708 +Subject: [PATCH 34/64] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -111737,10 +111739,10 @@ index 0000000..ebaf3d6 1.9.3 -From f95159f7151f7727a66d1b873789d0b3e910fc52 Mon Sep 17 00:00:00 2001 +From 5093874806c58c6b4a956ca3d3ddd3d1f33912d1 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:37:51 +0100 -Subject: [PATCH 35/54] BCM2708: Extend mach header +Subject: [PATCH 35/64] BCM2708: Extend mach header Extend the headers of the mach-bcm2708 in order to support I2S and DMA engine. @@ -111785,10 +111787,10 @@ index 992a630..2e7e1bb 100644 1.9.3 -From a52ed2ef06b539ad69fe0279d8aedb26804996fc Mon Sep 17 00:00:00 2001 +From 6422382c791d85671a06947a7fa1f5a549d5c3a3 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 36/54] ASoC: Add support for PCM5102A codec +Subject: [PATCH 36/64] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -111916,10 +111918,10 @@ index 0000000..126f1e9 1.9.3 -From 4d2a15160575aa8cb63d78a46d3229f2ecdfbf98 Mon Sep 17 00:00:00 2001 +From ad81742a1fbe7c097daf3f6a13a406b19dc13d3d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 37/54] BCM2708: Add I2S support to board file +Subject: [PATCH 37/64] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -111977,10 +111979,10 @@ index ef0935f..7cb8a8e 100644 1.9.3 -From b902daf06f4a3d61dbe79cf0ec9b257c85fe9c1d Mon Sep 17 00:00:00 2001 +From bf214bf792fe74bb28af994ec8d0297287b2dbfa Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 38/54] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 38/64] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -112132,10 +112134,10 @@ index 0000000..4b70b45 1.9.3 -From 7e6bb6d22c1d5961a4b7d823ca4990577e0ec230 Mon Sep 17 00:00:00 2001 +From 0184bd07bc1cbe6a4393e6d921696c00b61cc5c8 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 39/54] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 39/64] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -112186,10 +112188,10 @@ index 7cb8a8e..c4dc10e 100644 1.9.3 -From e9fcabbabda87282ff14cd62837b8c5fb7b29673 Mon Sep 17 00:00:00 2001 +From bcfe1b6e75d74f1ea4f114d8b2d6cac38a216197 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 18:55:53 +0100 -Subject: [PATCH 40/54] ASoC: BCM2708: Add 24 bit support +Subject: [PATCH 40/64] ASoC: BCM2708: Add 24 bit support This adds 24 bit support to the I2S driver of the BCM2708. Besides enabling the 24 bit flags, it includes two bug fixes: @@ -112264,10 +112266,10 @@ index ebaf3d6..a179216 100644 1.9.3 -From 5fe237762874b2971c5bf8fa9711cd7fd29b7be1 Mon Sep 17 00:00:00 2001 +From 3354beaded51a2ff69c0df240d4a4b0950928a47 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 2 Dec 2013 20:28:22 +0100 -Subject: [PATCH 41/54] BCM2708: Add I2S and DMA support to default config +Subject: [PATCH 41/64] BCM2708: Add I2S and DMA support to default config This commit adds several modules that are needed for I2S support for the Raspberry Pi to the defconfig. @@ -112310,10 +112312,10 @@ index d70da44..36e7473 100644 1.9.3 -From 13502daa009c7970b41202cc34c6e3d757476c47 Mon Sep 17 00:00:00 2001 +From 8bdb6605a3428512fd974cce4977d7dea7d09647 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 42/54] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 42/64] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -112627,10 +112629,10 @@ index 0000000..b4eaa44 1.9.3 -From bb796a84fb72f20b97008b62766aba9b0f1f0aa2 Mon Sep 17 00:00:00 2001 +From 53bdb30aeb3fb612dc3317f52d563869064b9262 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 43/54] ASoC: wm8804: Implement MCLK configuration options, add +Subject: [PATCH 43/64] ASoC: wm8804: Implement MCLK configuration options, add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most sample rates. At 192kHz only 128xfs is supported. The existing driver selects 128xfs automatically for some lower samples rates. By using an @@ -112747,10 +112749,10 @@ index 8ec14f5..e72d4f4 100644 1.9.3 -From 72a1c736563d1d7696cfef21fae4f6cdcccb7539 Mon Sep 17 00:00:00 2001 +From e195e9cab91a44292175d2a2d5a6b7c01b347195 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 44/54] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 44/64] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -112956,10 +112958,10 @@ index 0000000..e4f769d 1.9.3 -From 09323a6e350b335de392864e3d299305f74ac904 Mon Sep 17 00:00:00 2001 +From de58101b3a5ba8de5fc1daec86962565ceb3a819 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 45/54] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 45/64] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -113009,10 +113011,10 @@ index f2b3990..f5afd86 100644 1.9.3 -From caa3a5c3dd0948bdb22f5e5d584a7a90ddb7c809 Mon Sep 17 00:00:00 2001 +From e82c150fbb033cf6ecad32333c1d71d9acf271e1 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:27:28 +0100 -Subject: [PATCH 46/54] BCM2708: Added HiFiBerry Digi configuration option It +Subject: [PATCH 46/64] BCM2708: Added HiFiBerry Digi configuration option It will be compiled as a module by default. This also includes the WM8804 driver. @@ -113040,10 +113042,10 @@ index f877ab2..3d3c8ab 100644 1.9.3 -From 43fa6b1607d23abfb38f1df99c402a2c33818d2b Mon Sep 17 00:00:00 2001 +From 6a08a9e4a1cf9ef0573f8bc6b807601208aef203 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 47/54] ASoC: wm8804: Set idle_bias_off to false Idle bias has +Subject: [PATCH 47/64] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -113068,10 +113070,10 @@ index d8923c1..2787042 100644 1.9.3 -From 34eb11fc484998a647a7d01ca3fe86dbc4815d8e Mon Sep 17 00:00:00 2001 +From 0eaa2754de8646ce49cd8334f61f736fd54b5e41 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 12 Mar 2014 11:46:34 +0000 -Subject: [PATCH 48/54] ASoc: Don't report S24_LE support, it produces white +Subject: [PATCH 48/64] ASoc: Don't report S24_LE support, it produces white noise with xbmc --- @@ -113109,10 +113111,10 @@ index 126f1e9..7812d34 100644 1.9.3 -From fad6180821496768e424233db1996980cb06f8ff Mon Sep 17 00:00:00 2001 +From 63e8d7a7c335421011848520ed1a8cc1ba78d8a9 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 49/54] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 49/64] Add IQaudIO Sound Card support for Raspberry Pi --- arch/arm/configs/bcmrpi_defconfig | 1 + @@ -113917,10 +113919,10 @@ index 6ee76aa..b2f518e 100644 1.9.3 -From 864325d1c4245cf3c0aed2aedf530d11b85db847 Mon Sep 17 00:00:00 2001 +From 7571ebdbb4602cc392e7afeb43dec1d7cf1c5c58 Mon Sep 17 00:00:00 2001 From: Howard Mitchell Date: Fri, 28 Mar 2014 16:27:57 +0000 -Subject: [PATCH 50/54] Fix volsw_range functions so SOC_DOUBLE_R_RANGE_TLV +Subject: [PATCH 50/64] Fix volsw_range functions so SOC_DOUBLE_R_RANGE_TLV works. This is so that the correct rabge of values as specified @@ -113996,10 +113998,10 @@ index 051c006..bf39f16 100644 1.9.3 -From 58adc022393093e4088fa635ec89676478db3770 Mon Sep 17 00:00:00 2001 +From 69e39dee769df531ad54dc709670159ebf4341c7 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sun, 30 Mar 2014 13:52:33 +0100 -Subject: [PATCH 51/54] fix soc-core's inverse range and let IQaudIO DAC use +Subject: [PATCH 51/64] fix soc-core's inverse range and let IQaudIO DAC use this fixed SOC_DOUBLE_R_RANGE_TLV support --- @@ -114036,10 +114038,10 @@ index bf39f16..4d8917b 100644 1.9.3 -From e85b5776750f69d5d3b323af673acc2dd8f4f80b Mon Sep 17 00:00:00 2001 +From 84ea137d0e7ae7bc62f37130cd7f26f12247534c Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Fri, 2 May 2014 16:13:59 +0100 -Subject: [PATCH 52/54] Move GPIO setup to hw_params. +Subject: [PATCH 52/64] Move GPIO setup to hw_params. This is used to stop the I2S driver from breaking the GPIO setup for other uses of the PCM interface @@ -114138,10 +114140,10 @@ index b25e158..9976571 100644 1.9.3 -From d4782b92cf0a1d557bf9af79fd5e8a0e1189f3d8 Mon Sep 17 00:00:00 2001 +From 776049380ffa1bda8b77ade8109991a95e50ca7e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 9 May 2014 15:45:13 +0100 -Subject: [PATCH 53/54] fb: distinguish physical and bus addresses +Subject: [PATCH 53/64] fb: distinguish physical and bus addresses --- drivers/video/fbdev/bcm2708_fb.c | 15 +++++++++------ @@ -114216,40 +114218,979 @@ index 798eb52..b3b1e04 100644 1.9.3 -From 959a708cea1c7e044032bd7e904e72dcf0a51db4 Mon Sep 17 00:00:00 2001 +From 84f90e8ddd31103c570ea7dadffdb1bace8bd985 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 10 Jun 2014 15:49:57 +0100 -Subject: [PATCH 54/54] hwrng: bcm2708 - fix oops when rng h/w is accessed - during registration +Date: Wed, 18 Jun 2014 13:42:01 +0100 +Subject: [PATCH 54/64] vmstat: Workaround for issue where dirty page count + goes negative + +See: +https://github.com/raspberrypi/linux/issues/617 +http://www.spinics.net/lists/linux-mm/msg72236.html +--- + include/linux/vmstat.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h +index 45c9cd1..07dad05 100644 +--- a/include/linux/vmstat.h ++++ b/include/linux/vmstat.h +@@ -235,7 +235,11 @@ static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) + static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) + { + atomic_long_dec(&zone->vm_stat[item]); ++ if (item == NR_FILE_DIRTY && unlikely(atomic_long_read(&zone->vm_stat[item]) < 0)) ++ atomic_long_set(&zone->vm_stat[item], 0); + atomic_long_dec(&vm_stat[item]); ++ if (item == NR_FILE_DIRTY && unlikely(atomic_long_read(&vm_stat[item]) < 0)) ++ atomic_long_set(&vm_stat[item], 0); + } + + static inline void __inc_zone_page_state(struct page *page, +-- +1.9.3 + + +From f445a8bb0063352894db55cd940b0a0100c301bf Mon Sep 17 00:00:00 2001 +From: P33M +Date: Fri, 20 Jun 2014 16:03:12 +0100 +Subject: [PATCH 55/64] dwc_otg: Fix various issues with root port and + transaction errors + +Process the host port interrupts correctly (and don't trample them). +Root port hotplug now functional again. + +Fix a few thinkos with the transaction error passthrough for fiq_fsm. +--- + drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c | 7 +++---- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 6 +++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 2 +- + 3 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c +index 065807f..96c76e3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c +@@ -1348,10 +1348,9 @@ static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin + local_fiq_disable(); + /* Pull in the interrupts that the FIQ has masked */ + gintmsk.d32 |= ~(hcd->fiq_state->gintmsk_saved.d32); ++ gintmsk.d32 |= gintmsk_common.d32; + /* for the upstairs function to reenable - have to read it here in case FIQ triggers again */ +- reenable_gintmsk->d32 |= gintmsk.d32; +- reenable_gintmsk->d32 |= ~(hcd->fiq_state->gintmsk_saved.d32); +- reenable_gintmsk->d32 &= gintmsk_common.d32; ++ reenable_gintmsk->d32 = gintmsk.d32; + local_fiq_enable(); + } + +@@ -1535,7 +1534,7 @@ int32_t dwc_otg_handle_common_intr(void *dev) + // fiq_print(FIQDBG_INT, otg_dev->hcd->fiq_state, "CILOUT %1d", retval); + // fiq_print(FIQDBG_INT, otg_dev->hcd->fiq_state, "%08x", gintsts.d32); + // fiq_print(FIQDBG_INT, otg_dev->hcd->fiq_state, "%08x", gintmsk_reenable.d32); +- if (retval) { ++ if (retval && fiq_enable) { + DWC_WRITE_REG32(&core_if->core_global_regs->gintmsk, gintmsk_reenable.d32); + } + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +index 7aad7f7..f9d65e7 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +@@ -696,7 +696,11 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + fiq_print(FIQDBG_ERR, state, "ERRST %02d", n); + if (hcint_probe.b.nak || hcint_probe.b.ack || hcint_probe.b.datatglerr) { + fiq_print(FIQDBG_ERR, state, "RESET %02d", n); +- st->nr_errors = 0; ++ /* In some random cases we can get a NAK interrupt coincident with a Xacterr ++ * interrupt, after the device has disappeared. ++ */ ++ if (!hcint.b.xacterr) ++ st->nr_errors = 0; + hcintmsk.b.nak = 0; + hcintmsk.b.ack = 0; + hcintmsk.b.datatglerr = 0; +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index d3e2035..6182d3e 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -2619,7 +2619,7 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num) + case FIQ_PASSTHROUGH_ERRORSTATE: + /* Hook into the error count */ + fiq_print(FIQDBG_ERR, dwc_otg_hcd->fiq_state, "HCDERR%02d", num); +- if (dwc_otg_hcd->fiq_state->channel[num].nr_errors) { ++ if (!dwc_otg_hcd->fiq_state->channel[num].nr_errors) { + qtd->error_count = 0; + fiq_print(FIQDBG_ERR, dwc_otg_hcd->fiq_state, "RESET "); + } +-- +1.9.3 + + +From 2c049a3ce5174681af289ca153a1331b5e49c50c Mon Sep 17 00:00:00 2001 +From: P33M +Date: Fri, 20 Jun 2014 17:23:20 +0100 +Subject: [PATCH 56/64] fiq_fsm: Implement hack for Split Interrupt + transactions + +Hubs aren't too picky about which endpoint we send Control type split +transactions to. By treating Interrupt transfers as Control, it is +possible to use the non-periodic queue in the OTG core as well as the +non-periodic FIFOs in the hub itself. This massively reduces the +microframe exclusivity/contention that periodic split transactions +otherwise have to enforce. + +It goes without saying that this is a fairly egregious USB specification +violation, but it works. + +Original idea by Hans Petter Selasky @ FreeBSD.org. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index daea770..35721e5 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1050,10 +1050,11 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) + for (i=0; i < hcd->core_if->core_params->host_channels; i++) { + dwc_otg_cleanup_fiq_channel(hcd, i); + } +- DWC_PRINTF("FIQ FSM acceleration enabled for :\n%s%s%s", ++ DWC_PRINTF("FIQ FSM acceleration enabled for :\n%s%s%s%s", + (fiq_fsm_mask & 0x1) ? "Non-periodic Split Transactions\n" : "", + (fiq_fsm_mask & 0x2) ? "Periodic Split Transactions\n" : "", +- (fiq_fsm_mask & 0x4) ? "High-Speed Isochronous Endpoints\n" : ""); ++ (fiq_fsm_mask & 0x4) ? "High-Speed Isochronous Endpoints\n" : "", ++ (fiq_fsm_mask & 0x8) ? "Interrupt/Control Split Transaction hack enabled\n" : ""); + } + } + +@@ -1784,6 +1785,20 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + st->hcintmsk_copy.b.chhltd = 1; + st->hcintmsk_copy.b.ahberr = 1; + ++ /* Hack courtesy of FreeBSD: apparently forcing Interrupt Split transactions ++ * as Control puts the transfer into the non-periodic request queue and the ++ * non-periodic handler in the hub. Makes things lots easier. ++ */ ++ if ((fiq_fsm_mask & 0x8) && hc->ep_type == UE_INTERRUPT) { ++ st->hcchar_copy.b.multicnt = 0; ++ st->hcchar_copy.b.oddfrm = 0; ++ st->hcchar_copy.b.eptype = UE_CONTROL; ++ if (hc->align_buff) { ++ st->hcdma_copy.d32 = hc->align_buff; ++ } else { ++ st->hcdma_copy.d32 = ((unsigned long) hc->xfer_buff & 0xFFFFFFFF); ++ } ++ } + DWC_WRITE_REG32(&hc_regs->hcdma, st->hcdma_copy.d32); + DWC_WRITE_REG32(&hc_regs->hctsiz, st->hctsiz_copy.d32); + DWC_WRITE_REG32(&hc_regs->hcsplt, st->hcsplt_copy.d32); +@@ -1837,6 +1852,9 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + } + } ++ if ((fiq_fsm_mask & 0x8) && hc->ep_type == UE_INTERRUPT) ++ start_immediate = 1; ++ + fiq_print(FIQDBG_INT, hcd->fiq_state, "FSMQ %01d %01d", hc->hc_num, start_immediate); + fiq_print(FIQDBG_INT, hcd->fiq_state, "%08d", hfnum.b.frrem); + //fiq_print(FIQDBG_INT, hcd->fiq_state, "H:%02dP:%02d", hub_addr, port_addr); +@@ -1868,11 +1886,13 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + break; + case UE_INTERRUPT: +- if (start_immediate) { ++ if (fiq_fsm_mask & 0x8) { ++ st->fsm = FIQ_NP_SSPLIT_STARTED; ++ } else if (start_immediate) { + st->fsm = FIQ_PER_SSPLIT_STARTED; +- } else { +- st->fsm = FIQ_PER_SSPLIT_QUEUED; +- } ++ } else { ++ st->fsm = FIQ_PER_SSPLIT_QUEUED; ++ } + default: + break; + } +-- +1.9.3 + + +From 214f30d8852405583669eb864931c0cf2795113f Mon Sep 17 00:00:00 2001 +From: notro +Date: Sun, 6 Jul 2014 12:07:25 +0200 +Subject: [PATCH 57/64] spi-bcm2708: Prepare for Common Clock Framework + migration + +As part of migrating to use the Common Clock Framework, replace clk_enable() +with clk_prepare_enable() and clk_disable() with clk_disable_unprepare(). +This does not affect behaviour under the current clock implementation. + +Also add a missing clk_disable_unprepare() in the probe error path. + +Signed-off-by: Noralf Tronnes +--- + drivers/spi/spi-bcm2708.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +index 06dd02f..0952f40 100644 +--- a/drivers/spi/spi-bcm2708.c ++++ b/drivers/spi/spi-bcm2708.c +@@ -545,7 +545,7 @@ static int bcm2708_spi_probe(struct platform_device *pdev) + } + + /* initialise the hardware */ +- clk_enable(clk); ++ clk_prepare_enable(clk); + bcm2708_wr(bs, SPI_CS, SPI_CS_REN | SPI_CS_CLEAR_RX | SPI_CS_CLEAR_TX); + + err = spi_register_master(master); +@@ -561,6 +561,7 @@ static int bcm2708_spi_probe(struct platform_device *pdev) + + out_free_irq: + free_irq(bs->irq, master); ++ clk_disable_unprepare(bs->clk); + out_workqueue: + destroy_workqueue(bs->workq); + out_iounmap: +@@ -585,7 +586,7 @@ static int bcm2708_spi_remove(struct platform_device *pdev) + + flush_work_sync(&bs->work); + +- clk_disable(bs->clk); ++ clk_disable_unprepare(bs->clk); + clk_put(bs->clk); + free_irq(bs->irq, master); + iounmap(bs->base); +-- +1.9.3 + + +From b8f8b3c46ade5a9146538a925d81e1c12ead332a Mon Sep 17 00:00:00 2001 +From: notro +Date: Sun, 6 Jul 2014 12:09:30 +0200 +Subject: [PATCH 58/64] BCM2708: Migrate to the Common Clock Framework + +As part of moving towards using Device Tree, the Common Clock Framework +has to be used instead of the BCM2708 clock implementation. + +Selecting COMMON_CLK removes the need to set CLKDEV_LOOKUP and HAVE_CLK explicitly. + +CONFIG_ARCH_BCM2708_CHIPIT #ifdef's are removed. They are no longer in use. + +Signed-off-by: Noralf Tronnes +--- + arch/arm/Kconfig | 3 +- + arch/arm/mach-bcm2708/Makefile | 2 +- + arch/arm/mach-bcm2708/bcm2708.c | 84 ++++++++++++++++++----------------------- + arch/arm/mach-bcm2708/clock.c | 61 ------------------------------ + arch/arm/mach-bcm2708/clock.h | 24 ------------ + 5 files changed, 39 insertions(+), 135 deletions(-) + delete mode 100644 arch/arm/mach-bcm2708/clock.c + delete mode 100644 arch/arm/mach-bcm2708/clock.h + +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 2719812..f57f958 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -388,11 +388,10 @@ config ARCH_BCM2708 + bool "Broadcom BCM2708 family" + select CPU_V6 + select ARM_AMBA +- select HAVE_CLK + select HAVE_SCHED_CLOCK + select NEED_MACH_GPIO_H + select NEED_MACH_MEMORY_H +- select CLKDEV_LOOKUP ++ select COMMON_CLK + select ARCH_HAS_CPUFREQ + select GENERIC_CLOCKEVENTS + select ARM_ERRATA_411920 +diff --git a/arch/arm/mach-bcm2708/Makefile b/arch/arm/mach-bcm2708/Makefile +index a722f3f..21e3521 100644 +--- a/arch/arm/mach-bcm2708/Makefile ++++ b/arch/arm/mach-bcm2708/Makefile +@@ -2,6 +2,6 @@ + # Makefile for the linux kernel. + # + +-obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o ++obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o vcio.o power.o dma.o + obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o + obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index b0aec82..26fe14e 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -58,7 +60,6 @@ + + #include "bcm2708.h" + #include "armctrl.h" +-#include "clock.h" + + #ifdef CONFIG_BCM_VC_CMA + #include +@@ -84,7 +85,7 @@ + + /* command line parameters */ + static unsigned boardrev, serial; +-static unsigned uart_clock; ++static unsigned uart_clock = UART0_CLOCK; + static unsigned disk_led_gpio = 16; + static unsigned disk_led_active_low = 1; + static unsigned reboot_part = 0; +@@ -196,51 +197,44 @@ static void __init bcm2708_clocksource_init(void) + } + } + ++struct clk __init *bcm2708_clk_register(const char *name, unsigned long fixed_rate) ++{ ++ struct clk *clk; + +-/* +- * These are fixed clocks. +- */ +-static struct clk ref24_clk = { +- .rate = UART0_CLOCK, /* The UART is clocked at 3MHz via APB_CLK */ +-}; ++ clk = clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, ++ fixed_rate); ++ if (IS_ERR(clk)) ++ pr_err("%s not registered\n", name); + +-static struct clk osc_clk = { +-#ifdef CONFIG_ARCH_BCM2708_CHIPIT +- .rate = 27000000, +-#else +- .rate = 500000000, /* ARM clock is set from the VideoCore booter */ +-#endif +-}; ++ return clk; ++} + +-/* warning - the USB needs a clock > 34MHz */ ++void __init bcm2708_register_clkdev(struct clk *clk, const char *name) ++{ ++ int ret; + +-static struct clk sdhost_clk = { +-#ifdef CONFIG_ARCH_BCM2708_CHIPIT +- .rate = 4000000, /* 4MHz */ +-#else +- .rate = 250000000, /* 250MHz */ +-#endif +-}; ++ ret = clk_register_clkdev(clk, NULL, name); ++ if (ret) ++ pr_err("%s alias not registered\n", name); ++} + +-static struct clk_lookup lookups[] = { +- { /* UART0 */ +- .dev_id = "dev:f1", +- .clk = &ref24_clk, +- }, +- { /* USB */ +- .dev_id = "bcm2708_usb", +- .clk = &osc_clk, +- }, { /* SPI */ +- .dev_id = "bcm2708_spi.0", +- .clk = &sdhost_clk, +- }, { /* BSC0 */ +- .dev_id = "bcm2708_i2c.0", +- .clk = &sdhost_clk, +- }, { /* BSC1 */ +- .dev_id = "bcm2708_i2c.1", +- .clk = &sdhost_clk, +- } +-}; ++void __init bcm2708_init_clocks(void) ++{ ++ struct clk *clk; ++ ++ clk = bcm2708_clk_register("uart0_clk", uart_clock); ++ bcm2708_register_clkdev(clk, "dev:f1"); ++ ++ /* ARM clock is set from the VideoCore booter */ ++ /* warning - the USB needs a clock > 34MHz */ ++ clk = bcm2708_clk_register("osc_clk", 500000000); ++ bcm2708_register_clkdev(clk, "bcm2708_usb"); ++ ++ clk = bcm2708_clk_register("sdhost_clk", 250000000); ++ bcm2708_register_clkdev(clk, "bcm2708_spi.0"); ++ bcm2708_register_clkdev(clk, "bcm2708_i2c.0"); ++ bcm2708_register_clkdev(clk, "bcm2708_i2c.1"); ++} + + #define UART0_IRQ { IRQ_UART, 0 /*NO_IRQ*/ } + #define UART0_DMA { 15, 14 } +@@ -783,11 +777,7 @@ void __init bcm2708_init(void) + printk("bcm2708.uart_clock = %d\n", uart_clock); + pm_power_off = bcm2708_power_off; + +- if (uart_clock) +- lookups[0].clk->rate = uart_clock; +- +- for (i = 0; i < ARRAY_SIZE(lookups); i++) +- clkdev_add(&lookups[i]); ++ bcm2708_init_clocks(); + + bcm_register_device(&bcm2708_dmaman_device); + bcm_register_device(&bcm2708_vcio_device); +diff --git a/arch/arm/mach-bcm2708/clock.c b/arch/arm/mach-bcm2708/clock.c +deleted file mode 100644 +index 4fc556e..0000000 +--- a/arch/arm/mach-bcm2708/clock.c ++++ /dev/null +@@ -1,61 +0,0 @@ +-/* +- * linux/arch/arm/mach-bcm2708/clock.c +- * +- * Copyright (C) 2010 Broadcom +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#include "clock.h" +- +-int clk_enable(struct clk *clk) +-{ +- return 0; +-} +-EXPORT_SYMBOL(clk_enable); +- +-void clk_disable(struct clk *clk) +-{ +-} +-EXPORT_SYMBOL(clk_disable); +- +-unsigned long clk_get_rate(struct clk *clk) +-{ +- return clk->rate; +-} +-EXPORT_SYMBOL(clk_get_rate); +- +-long clk_round_rate(struct clk *clk, unsigned long rate) +-{ +- return clk->rate; +-} +-EXPORT_SYMBOL(clk_round_rate); +- +-int clk_set_rate(struct clk *clk, unsigned long rate) +-{ +- return -EIO; +-} +-EXPORT_SYMBOL(clk_set_rate); +diff --git a/arch/arm/mach-bcm2708/clock.h b/arch/arm/mach-bcm2708/clock.h +deleted file mode 100644 +index 5f9d725..0000000 +--- a/arch/arm/mach-bcm2708/clock.h ++++ /dev/null +@@ -1,24 +0,0 @@ +-/* +- * linux/arch/arm/mach-bcm2708/clock.h +- * +- * Copyright (C) 2010 Broadcom +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- */ +-struct module; +- +-struct clk { +- unsigned long rate; +-}; +-- +1.9.3 + + +From 67ce1030a3a4c43ed6d96964c1f4577832f60f6e Mon Sep 17 00:00:00 2001 +From: notro +Date: Sun, 6 Jul 2014 16:31:31 +0200 +Subject: [PATCH 59/64] BCM2708: remove 'bcm2708_usb' clkdev + +'bcm2708_usb' is currently not in use by the USB OTG driver. + +Signed-off-by: Noralf Tronnes +--- + arch/arm/mach-bcm2708/bcm2708.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index 26fe14e..ef5a55dc 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -225,11 +225,6 @@ void __init bcm2708_init_clocks(void) + clk = bcm2708_clk_register("uart0_clk", uart_clock); + bcm2708_register_clkdev(clk, "dev:f1"); + +- /* ARM clock is set from the VideoCore booter */ +- /* warning - the USB needs a clock > 34MHz */ +- clk = bcm2708_clk_register("osc_clk", 500000000); +- bcm2708_register_clkdev(clk, "bcm2708_usb"); +- + clk = bcm2708_clk_register("sdhost_clk", 250000000); + bcm2708_register_clkdev(clk, "bcm2708_spi.0"); + bcm2708_register_clkdev(clk, "bcm2708_i2c.0"); +-- +1.9.3 + + +From 79f18a932ed1d3a4517ff339aa92465d279fc9c2 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 4 Jul 2014 22:54:16 +0100 +Subject: [PATCH 60/64] config: Add CONFIG_DEVPTS_MULTIPLE_INSTANCES --- - drivers/char/hw_random/bcm2708-rng.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) + arch/arm/configs/bcmrpi_defconfig | 1 + + 1 file changed, 1 insertion(+) -diff --git a/drivers/char/hw_random/bcm2708-rng.c b/drivers/char/hw_random/bcm2708-rng.c -index 1ffa7d7..340f004 100755 ---- a/drivers/char/hw_random/bcm2708-rng.c -+++ b/drivers/char/hw_random/bcm2708-rng.c -@@ -86,15 +86,16 @@ static int __init bcm2708_rng_init(void) - return -ENOMEM; - } - bcm2708_rng_ops.priv = (unsigned long)rng_base; -+ -+ /* set warm-up count & enable */ -+ __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); -+ __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); -+ - /* register driver */ - err = hwrng_register(&bcm2708_rng_ops); - if (err) { - pr_err("bcm2708_rng_init hwrng_register()=%d\n", err); - iounmap(rng_base); -- } else { -- /* set warm-up count & enable */ -- __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); -- __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); - } - return err; +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index a024670..29fe486 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -528,6 +528,7 @@ CONFIG_SERIO_RAW=m + CONFIG_GAMEPORT=m + CONFIG_GAMEPORT_NS558=m + CONFIG_GAMEPORT_L4=m ++CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + # CONFIG_LEGACY_PTYS is not set + # CONFIG_DEVKMEM is not set + CONFIG_SERIAL_AMBA_PL011=y +-- +1.9.3 + + +From f799f0130530380d3138c06db2b466559c4c56fd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 26 Jun 2014 19:03:47 +0100 +Subject: [PATCH 61/64] bcm2708: Avoid hang when timer_set_next_event is called + with MAX_INT + +See: https://github.com/raspberrypi/linux/issues/616 +--- + arch/arm/mach-bcm2708/bcm2708.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index ef5a55dc..9bf2508 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -870,7 +870,8 @@ static int timer_set_next_event(unsigned long cycles, + stc = readl(__io_address(ST_BASE + 0x04)); + /* We could take a FIQ here, which may push ST above STC3 */ + writel(stc + cycles, __io_address(ST_BASE + 0x18)); +- } while ((signed long) (readl(__io_address(ST_BASE + 0x04)) - stc) ++ } while ((signed long) cycles >= 0 && ++ (signed long) (readl(__io_address(ST_BASE + 0x04)) - stc) + >= (signed long) cycles); + return 0; + } +-- +1.9.3 + + +From 42f78884c65f580e246331f715f61a54ee139f5c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 26 Jun 2014 19:00:28 +0100 +Subject: [PATCH 62/64] armctrl: Don't mask interrupts from ack + +--- + arch/arm/mach-bcm2708/armctrl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c +index 274aa30..d4c5333 100644 +--- a/arch/arm/mach-bcm2708/armctrl.c ++++ b/arch/arm/mach-bcm2708/armctrl.c +@@ -184,7 +184,7 @@ late_initcall(armctrl_syscore_init); + + static struct irq_chip armctrl_chip = { + .name = "ARMCTRL", +- .irq_ack = armctrl_mask_irq, ++ .irq_ack = NULL, + .irq_mask = armctrl_mask_irq, + .irq_unmask = armctrl_unmask_irq, + .irq_set_wake = armctrl_set_wake, +-- +1.9.3 + + +From 33c51dbe7c3307a9c2e5a830d95571fa6296b9c3 Mon Sep 17 00:00:00 2001 +From: notro +Date: Wed, 9 Jul 2014 14:46:08 +0200 +Subject: [PATCH 63/64] BCM2708: Add core Device Tree support + +Add the bare minimum needed to boot BCM2708 from a Device Tree. + +Signed-off-by: Noralf Tronnes +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm2708-rpi-b.dts | 8 ++++++++ + arch/arm/boot/dts/bcm2708.dtsi | 27 +++++++++++++++++++++++++++ + arch/arm/mach-bcm2708/Kconfig | 8 ++++++++ + arch/arm/mach-bcm2708/bcm2708.c | 24 ++++++++++++++++++++++++ + 5 files changed, 68 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm2708-rpi-b.dts + create mode 100644 arch/arm/boot/dts/bcm2708.dtsi + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 377b7c3..c118dc8 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -50,6 +50,7 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb + dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb + + dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb ++dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb + dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb + dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \ +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +new file mode 100644 +index 0000000..e319c8e +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -0,0 +1,8 @@ ++/dts-v1/; ++ ++/include/ "bcm2708.dtsi" ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ model = "Raspberry Pi"; ++}; +diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi +new file mode 100644 +index 0000000..678bd45 +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2708.dtsi +@@ -0,0 +1,27 @@ ++/include/ "skeleton.dtsi" ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ model = "BCM2708"; ++ ++ chosen { ++ /* ++ bootargs must be 1024 characters long because the ++ VC bootloader can't expand it ++ */ ++ bootargs = "console=ttyAMA0 "; ++ }; ++ ++ axi { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x7e000000 0x20000000 0x02000000>; ++ }; ++ ++ clocks { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++}; +diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig +index e151ed4..182e7ba 100644 +--- a/arch/arm/mach-bcm2708/Kconfig ++++ b/arch/arm/mach-bcm2708/Kconfig +@@ -9,6 +9,14 @@ config MACH_BCM2708 + help + Include support for the Broadcom(R) BCM2708 platform. + ++config BCM2708_DT ++ bool "BCM2708 Device Tree support" ++ depends on MACH_BCM2708 ++ default n ++ select USE_OF ++ help ++ Enable Device Tree support for BCM2708 ++ + config BCM2708_GPIO + bool "BCM2708 gpio support" + depends on MACH_BCM2708 +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index 9bf2508..6929e2e 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -762,6 +763,22 @@ static void bcm2708_power_off(void) + } + } + ++#ifdef CONFIG_OF ++static void __init bcm2708_dt_init(void) ++{ ++ int ret; ++ ++ of_clk_init(NULL); ++ ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); ++ if (ret) { ++ pr_err("of_platform_populate failed: %d\n", ret); ++ BUG(); ++ } ++} ++#else ++static void __init bcm2708_dt_init(void) { } ++#endif /* CONFIG_OF */ ++ + void __init bcm2708_init(void) + { + int i; +@@ -773,6 +790,7 @@ void __init bcm2708_init(void) + pm_power_off = bcm2708_power_off; + + bcm2708_init_clocks(); ++ bcm2708_dt_init(); + + bcm_register_device(&bcm2708_dmaman_device); + bcm_register_device(&bcm2708_vcio_device); +@@ -996,6 +1014,11 @@ static void __init board_reserve(void) + #endif + } + ++static const char * const bcm2708_compat[] = { ++ "brcm,bcm2708", ++ NULL ++}; ++ + MACHINE_START(BCM2708, "BCM2708") + /* Maintainer: Broadcom Europe Ltd. */ + .map_io = bcm2708_map_io, +@@ -1005,6 +1028,7 @@ MACHINE_START(BCM2708, "BCM2708") + .init_early = bcm2708_init_early, + .reserve = board_reserve, + .restart = bcm2708_restart, ++ .dt_compat = bcm2708_compat, + MACHINE_END + + module_param(boardrev, uint, 0644); +-- +1.9.3 + + +From dba14197f482131aa88c5ae4c2606e6635aeee51 Mon Sep 17 00:00:00 2001 +From: notro +Date: Wed, 9 Jul 2014 14:47:48 +0200 +Subject: [PATCH 64/64] BCM2708: armctrl: Add IRQ Device Tree support + +Add Device Tree IRQ support for BCM2708. +Usage is the same as for irq-bcm2835. +See binding document: brcm,bcm2835-armctrl-ic.txt + +A bank 3 is added to handle GPIO interrupts. This is done because +armctrl also handles GPIO interrupts. + +Signed-off-by: Noralf Tronnes +--- + arch/arm/boot/dts/bcm2708.dtsi | 9 ++++ + arch/arm/mach-bcm2708/armctrl.c | 97 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 106 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi +index 678bd45..54ecab7 100644 +--- a/arch/arm/boot/dts/bcm2708.dtsi ++++ b/arch/arm/boot/dts/bcm2708.dtsi +@@ -4,6 +4,8 @@ + compatible = "brcm,bcm2708"; + model = "BCM2708"; + ++ interrupt-parent = <&intc>; ++ + chosen { + /* + bootargs must be 1024 characters long because the +@@ -17,6 +19,13 @@ + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x7e000000 0x20000000 0x02000000>; ++ ++ intc: interrupt-controller { ++ compatible = "brcm,bcm2708-armctrl-ic"; ++ reg = <0x7e00b200 0x200>; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ }; + }; + + clocks { +diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c +index d4c5333..42f5e1c 100644 +--- a/arch/arm/mach-bcm2708/armctrl.c ++++ b/arch/arm/mach-bcm2708/armctrl.c +@@ -23,6 +23,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -79,6 +81,100 @@ static void armctrl_unmask_irq(struct irq_data *d) + } + } + ++#ifdef CONFIG_OF ++ ++#define NR_IRQS_BANK0 21 ++#define NR_BANKS 3 + 1 /* bank 3 is used for GPIO interrupts */ ++#define IRQS_PER_BANK 32 ++ ++/* from drivers/irqchip/irq-bcm2835.c */ ++static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr, ++ const u32 *intspec, unsigned int intsize, ++ unsigned long *out_hwirq, unsigned int *out_type) ++{ ++ if (WARN_ON(intsize != 2)) ++ return -EINVAL; ++ ++ if (WARN_ON(intspec[0] >= NR_BANKS)) ++ return -EINVAL; ++ ++ if (WARN_ON(intspec[1] >= IRQS_PER_BANK)) ++ return -EINVAL; ++ ++ if (WARN_ON(intspec[0] == 0 && intspec[1] >= NR_IRQS_BANK0)) ++ return -EINVAL; ++ ++ if (intspec[0] == 0) ++ *out_hwirq = ARM_IRQ0_BASE + intspec[1]; ++ else if (intspec[0] == 1) ++ *out_hwirq = ARM_IRQ1_BASE + intspec[1]; ++ else if (intspec[0] == 2) ++ *out_hwirq = ARM_IRQ2_BASE + intspec[1]; ++ else ++ *out_hwirq = GPIO_IRQ_START + intspec[1]; ++ ++ /* reverse remap_irqs[] */ ++ switch (*out_hwirq) { ++ case INTERRUPT_VC_JPEG: ++ *out_hwirq = INTERRUPT_JPEG; ++ break; ++ case INTERRUPT_VC_USB: ++ *out_hwirq = INTERRUPT_USB; ++ break; ++ case INTERRUPT_VC_3D: ++ *out_hwirq = INTERRUPT_3D; ++ break; ++ case INTERRUPT_VC_DMA2: ++ *out_hwirq = INTERRUPT_DMA2; ++ break; ++ case INTERRUPT_VC_DMA3: ++ *out_hwirq = INTERRUPT_DMA3; ++ break; ++ case INTERRUPT_VC_I2C: ++ *out_hwirq = INTERRUPT_I2C; ++ break; ++ case INTERRUPT_VC_SPI: ++ *out_hwirq = INTERRUPT_SPI; ++ break; ++ case INTERRUPT_VC_I2SPCM: ++ *out_hwirq = INTERRUPT_I2SPCM; ++ break; ++ case INTERRUPT_VC_SDIO: ++ *out_hwirq = INTERRUPT_SDIO; ++ break; ++ case INTERRUPT_VC_UART: ++ *out_hwirq = INTERRUPT_UART; ++ break; ++ case INTERRUPT_VC_ARASANSDIO: ++ *out_hwirq = INTERRUPT_ARASANSDIO; ++ break; ++ } ++ ++ *out_type = IRQ_TYPE_NONE; ++ return 0; ++} ++ ++static struct irq_domain_ops armctrl_ops = { ++ .xlate = armctrl_xlate ++}; ++ ++void __init armctrl_dt_init(void) ++{ ++ struct device_node *np; ++ struct irq_domain *domain; ++ ++ np = of_find_compatible_node(NULL, NULL, "brcm,bcm2708-armctrl-ic"); ++ if (!np) ++ return; ++ ++ domain = irq_domain_add_legacy(np, NR_IRQS, IRQ_ARMCTRL_START, 0, ++ &armctrl_ops, NULL); ++ WARN_ON(!domain); ++} ++#else ++void __init armctrl_dt_init(void) { } ++#endif /* CONFIG_OF */ ++ + #if defined(CONFIG_PM) + + /* for kernels 3.xx use the new syscore_ops apis but for older kernels use the sys dev class */ +@@ -215,5 +311,6 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start, + + armctrl_pm_register(base, irq_start, resume_sources); + init_FIQ(FIQ_START); ++ armctrl_dt_init(); + return 0; } -- 1.9.3