Skip to content

Commit

Permalink
Merge branch 'rpi-4.14.y' into mtx-4.14.y
Browse files Browse the repository at this point in the history
  • Loading branch information
m-honda committed Sep 20, 2018
2 parents 3c67a56 + 675e29f commit f805949
Show file tree
Hide file tree
Showing 135 changed files with 920 additions and 336 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 69
SUBLEVEL = 70
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/bcm270x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

__overrides__ {
cam0-pwdn-ctrl;
cam0-pwdn;
cam0-led-ctrl;
cam0-led;
};
};

/* Configure and use the auxilliary interrupt controller */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
fe-pi-audio.dtbo \
goodix.dtbo \
googlevoicehat-soundcard.dtbo \
gpio-fan.dtbo \
gpio-ir.dtbo \
gpio-ir-tx.dtbo \
gpio-key.dtbo \
Expand Down
18 changes: 9 additions & 9 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,14 @@ Load: dtoverlay=googlevoicehat-soundcard
Params: <None>


Name: gpio-fan
Info: Configure a GPIO pin to control a cooling fan.
Load: dtoverlay=gpio-fan,<param>=<val>
Params: gpiopin GPIO used to control the fan (default 12)
temp Temperature at which the fan switches on, in
millicelcius (default 55000)


Name: gpio-ir
Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core-
based gpio_ir_recv driver maps received keys directly to a
Expand Down Expand Up @@ -1275,15 +1283,7 @@ Info: Omnivision OV5647 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
variants.
Load: dtoverlay=ov5647,<param>=<val>
Params: cam0-pwdn GPIO used to control the sensor powerdown line.

cam0-led GPIO used to control the sensor led
Both these fields should be automatically filled
in by the firmware to reflect the default GPIO
configuration of the particular Pi variant in
use.

i2c_pins_28_29 Use pins 28&29 for the I2C instead of 44&45.
Params: i2c_pins_28_29 Use pins 28&29 for the I2C instead of 44&45.
This is required for Pi B+, 2, 0, and 0W.


Expand Down
71 changes: 71 additions & 0 deletions arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
* Optional parameters:
* - "gpiopin" - default GPIO12
* - "temp" - default 55000
* Requires:
* - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m;
* - kernel rebuid;
* - DC Fan connected to GPIO via a N-MOSFET (2N7002)
*
* ┌─────────────────────┐
* │Fan negative terminal│
* └┬────────────────────┘
* │
* │──┘
* [GPIO12]──────┤ │<─┐ 2N7002
* │──┤
* │
* ─┴─
* GND
*
* sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
* sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
* or
* sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt"
* sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt"
*
*/
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target-path = "/";
__overlay__ {
fan0: gpio-fan@0 {
compatible = "gpio-fan";
gpios = <&gpio 12 1>;
gpio-fan,speed-map = <0 0>,
<5000 1>;
#cooling-cells = <2>;
};
};
};

fragment@1 {
target = <&cpu_thermal>;
polling-delay = <2000>; /* milliseconds */
__overlay__ {
trips {
cpu_hot: trip-point@0 {
temperature = <55000>; /* (millicelsius) Fan started at 55°C */
hysteresis = <5000>; /* (millicelsius) Fan stopped at 50°C */
type = "active";
};
};
cooling-maps {
map0 {
trip = <&cpu_hot>;
cooling-device = <&fan0 1 1>;
};
};
};
};
__overrides__ {
gpiopin = <&fan0>,"gpios:4", <&fan0>,"brcm,pins:0";
temp = <&cpu_hot>,"temperature:0";
};
};
12 changes: 10 additions & 2 deletions arch/arm/boot/dts/overlays/ov5647-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,17 @@
};
};

fragment@5 {
target-path="/__overrides__";
__overlay__ {
cam0-pwdn-ctrl = <&ov5647>,"pwdn-gpios:0";
cam0-pwdn = <&ov5647>,"pwdn-gpios:4";
cam0-led-ctrl = <&ov5647>,"pwdn-gpios:12";
cam0-led = <&ov5647>,"pwdn-gpios:16";
};
};

__overrides__ {
i2c_pins_28_29 = <0>,"+4-5";
cam0-pwdn = <&ov5647>,"pwdn-gpios:4";
cam0-led = <&ov5647>,"pwdn-gpios:16";
};
};
3 changes: 2 additions & 1 deletion arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ CONFIG_BATTERY_DS2760=m
CONFIG_BATTERY_GAUGE_LTC2941=m
CONFIG_HWMON=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_GPIO_FAN=m
CONFIG_SENSORS_JC42=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_RPI_POE_FAN=m
Expand Down Expand Up @@ -915,10 +916,10 @@ CONFIG_SND_PISOUND=m
CONFIG_SND_SOC_ADAU1701=m
CONFIG_SND_SOC_ADAU7002=m
CONFIG_SND_SOC_AK4554=m
CONFIG_SND_SOC_CS4265=m
CONFIG_SND_SOC_CS4271_I2C=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_WM8804_I2C=m
CONFIG_SND_SOC_CS4265=m
CONFIG_SND_SIMPLE_CARD=m
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ CONFIG_BATTERY_DS2760=m
CONFIG_BATTERY_GAUGE_LTC2941=m
CONFIG_HWMON=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_GPIO_FAN=m
CONFIG_SENSORS_JC42=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_RPI_POE_FAN=m
Expand Down Expand Up @@ -908,10 +909,10 @@ CONFIG_SND_PISOUND=m
CONFIG_SND_SOC_ADAU1701=m
CONFIG_SND_SOC_ADAU7002=m
CONFIG_SND_SOC_AK4554=m
CONFIG_SND_SOC_CS4265=m
CONFIG_SND_SOC_CS4271_I2C=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_WM8804_I2C=m
CONFIG_SND_SOC_CS4265=m
CONFIG_SND_SIMPLE_CARD=m
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/configs/imx_v6_v7_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_ULPI=y
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=m
Expand Down Expand Up @@ -326,7 +325,6 @@ CONFIG_USB_GADGETFS=m
CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_USB_ULPI_BUS=y
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-rockchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config ARCH_ROCKCHIP
select ARM_GLOBAL_TIMER
select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
select ZONE_DMA if ARM_LPAE
select PM
help
Support for Rockchip's Cortex-A9 Single-to-Quad-Core-SoCs
containing the RK2928, RK30xx and RK31xx series.
1 change: 1 addition & 0 deletions arch/arm64/Kconfig.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ config ARCH_ROCKCHIP
select GPIOLIB
select PINCTRL
select PINCTRL_ROCKCHIP
select PM
select ROCKCHIP_TIMER
help
This enables support for the ARMv8 based Rockchip chipsets,
Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@

#define CTR_L1IP_SHIFT 14
#define CTR_L1IP_MASK 3
#define CTR_DMINLINE_SHIFT 16
#define CTR_IMINLINE_SHIFT 0
#define CTR_CWG_SHIFT 24
#define CTR_CWG_MASK 15

#define CTR_CACHE_MINLINE_MASK \
(0xf << CTR_DMINLINE_SHIFT | 0xf << CTR_IMINLINE_SHIFT)

#define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)

#define ICACHE_POLICY_VPIPT 0
Expand Down
3 changes: 2 additions & 1 deletion arch/arm64/include/asm/cpucaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
#define ARM64_HARDEN_BRANCH_PREDICTOR 24
#define ARM64_HARDEN_BP_POST_GUEST_EXIT 25
#define ARM64_SSBD 26
#define ARM64_MISMATCHED_CACHE_TYPE 27

#define ARM64_NCAPS 27
#define ARM64_NCAPS 28

#endif /* __ASM_CPUCAPS_H */
25 changes: 20 additions & 5 deletions arch/arm64/kernel/cpu_errata.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <linux/arm-smccc.h>
#include <linux/psci.h>
#include <linux/types.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
Expand Down Expand Up @@ -45,12 +47,18 @@ is_kryo_midr(const struct arm64_cpu_capabilities *entry, int scope)
}

static bool
has_mismatched_cache_line_size(const struct arm64_cpu_capabilities *entry,
int scope)
has_mismatched_cache_type(const struct arm64_cpu_capabilities *entry,
int scope)
{
u64 mask = CTR_CACHE_MINLINE_MASK;

/* Skip matching the min line sizes for cache type check */
if (entry->capability == ARM64_MISMATCHED_CACHE_TYPE)
mask ^= arm64_ftr_reg_ctrel0.strict_mask;

WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
return (read_cpuid_cachetype() & arm64_ftr_reg_ctrel0.strict_mask) !=
(arm64_ftr_reg_ctrel0.sys_val & arm64_ftr_reg_ctrel0.strict_mask);
return (read_cpuid_cachetype() & mask) !=
(arm64_ftr_reg_ctrel0.sys_val & mask);
}

static int cpu_enable_trap_ctr_access(void *__unused)
Expand Down Expand Up @@ -511,7 +519,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
{
.desc = "Mismatched cache line size",
.capability = ARM64_MISMATCHED_CACHE_LINE_SIZE,
.matches = has_mismatched_cache_line_size,
.matches = has_mismatched_cache_type,
.def_scope = SCOPE_LOCAL_CPU,
.enable = cpu_enable_trap_ctr_access,
},
{
.desc = "Mismatched cache type",
.capability = ARM64_MISMATCHED_CACHE_TYPE,
.matches = has_mismatched_cache_type,
.def_scope = SCOPE_LOCAL_CPU,
.enable = cpu_enable_trap_ctr_access,
},
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ static const struct arm64_ftr_bits ftr_ctr[] = {
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 28, 1, 1), /* IDC */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 20, 4, 0), /* ERG */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1),
/*
* Linux can handle differing I-cache policies. Userspace JITs will
* make use of *minLine.
* If we have differing I-cache policies, report it as the weakest - VIPT.
*/
ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_VIPT), /* L1Ip */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0), /* IminLine */
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IMINLINE_SHIFT, 4, 0),
ARM64_FTR_END,
};

Expand Down
13 changes: 10 additions & 3 deletions arch/powerpc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,17 @@ do { \
} \
} while (0)

/*
* This is a type: either unsigned long, if the argument fits into
* that type, or otherwise unsigned long long.
*/
#define __long_type(x) \
__typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))

#define __get_user_nocheck(x, ptr, size) \
({ \
long __gu_err; \
unsigned long __gu_val; \
__long_type(*(ptr)) __gu_val; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
__chk_user_ptr(ptr); \
if (!is_kernel_addr((unsigned long)__gu_addr)) \
Expand All @@ -239,7 +246,7 @@ do { \
#define __get_user_check(x, ptr, size) \
({ \
long __gu_err = -EFAULT; \
unsigned long __gu_val = 0; \
__long_type(*(ptr)) __gu_val = 0; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
might_fault(); \
if (access_ok(VERIFY_READ, __gu_addr, (size))) \
Expand All @@ -251,7 +258,7 @@ do { \
#define __get_user_nosleep(x, ptr, size) \
({ \
long __gu_err; \
unsigned long __gu_val; \
__long_type(*(ptr)) __gu_val; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
__chk_user_ptr(ptr); \
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/kernel/exceptions-64s.S
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,8 @@ TRAMP_REAL_BEGIN(stf_barrier_fallback)
TRAMP_REAL_BEGIN(rfi_flush_fallback)
SET_SCRATCH0(r13);
GET_PACA(r13);
std r1,PACA_EXRFI+EX_R12(r13)
ld r1,PACAKSAVE(r13)
std r9,PACA_EXRFI+EX_R9(r13)
std r10,PACA_EXRFI+EX_R10(r13)
std r11,PACA_EXRFI+EX_R11(r13)
Expand Down Expand Up @@ -1486,12 +1488,15 @@ TRAMP_REAL_BEGIN(rfi_flush_fallback)
ld r9,PACA_EXRFI+EX_R9(r13)
ld r10,PACA_EXRFI+EX_R10(r13)
ld r11,PACA_EXRFI+EX_R11(r13)
ld r1,PACA_EXRFI+EX_R12(r13)
GET_SCRATCH0(r13);
rfid

TRAMP_REAL_BEGIN(hrfi_flush_fallback)
SET_SCRATCH0(r13);
GET_PACA(r13);
std r1,PACA_EXRFI+EX_R12(r13)
ld r1,PACAKSAVE(r13)
std r9,PACA_EXRFI+EX_R9(r13)
std r10,PACA_EXRFI+EX_R10(r13)
std r11,PACA_EXRFI+EX_R11(r13)
Expand Down Expand Up @@ -1526,6 +1531,7 @@ TRAMP_REAL_BEGIN(hrfi_flush_fallback)
ld r9,PACA_EXRFI+EX_R9(r13)
ld r10,PACA_EXRFI+EX_R10(r13)
ld r11,PACA_EXRFI+EX_R11(r13)
ld r1,PACA_EXRFI+EX_R12(r13)
GET_SCRATCH0(r13);
hrfid

Expand Down
Loading

0 comments on commit f805949

Please sign in to comment.