platform/kernel/linux-amlogic.git
7 years agoUART: setting clk81 gate and clock source by dts
Qi Duan [Thu, 29 Jun 2017 06:55:15 +0000 (14:55 +0800)]
UART: setting clk81 gate and clock source by dts

PD#146725: UART: setting clk81 gate and clock source by dts [1/1]

Change-Id: I5d1bacb9d59db250372100fc93263b1f0412027f
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agoirblaster: add irblaster config & dts
Yueguie He [Thu, 29 Jun 2017 06:27:27 +0000 (14:27 +0800)]
irblaster: add irblaster config & dts

PD#146700: add irblaster config & dts
1. add irblaster config
2. add irblaster dts

Change-Id: I2c82b43c904041a89c3eb1521970c3c8ac37d3e1
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agoscript: remove error for change-id when checkpatch
jianxin.pan [Thu, 29 Jun 2017 05:20:06 +0000 (13:20 +0800)]
script: remove error for change-id when checkpatch

PD#138714: remove the following error when checkpatch
Remove Gerrit Change-Id's before submitting upstream

Change-Id: I7276a44cef37d7cc4906be996d6eb9a19ae1102a
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
7 years agodts: axg: add unifykey
Yueguie He [Thu, 29 Jun 2017 05:43:47 +0000 (13:43 +0800)]
dts: axg: add unifykey

PD#146698: add unifykey
1. add unifykey,usid,mac,secure_boot_set,mac_bt,mac_wifi,deviceid.
2. enable efuse.

Change-Id: Ifcc902aae8d019235ef506fb6ba864feb29f3a3b
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agoadc_keypad: update interface to access adc and add sysfs interface
xingyu.chen [Wed, 28 Jun 2017 06:17:12 +0000 (14:17 +0800)]
adc_keypad: update interface to access adc and add sysfs interface

PD#146614: adc_keypad: update interface to access adc and add sysfs interface

1.use sysfs interface to set dynamic key
inquire key map:
cat /sys/devices/platform/adc_keypad/table

set key:
echo [name]:[code]:[channel]:[value]:[tolerance] >
/sys/devices/platform/adc_keypad/table

2. use the consumer interface of the IIO to access sar adc

Change-Id: I0357e84720340b0fee4baa882f41f0aa7f36a9a1
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agoaudio: fix tlv320adc3101 support S24_LE and 16k
Alex Deng [Wed, 28 Jun 2017 11:06:25 +0000 (19:06 +0800)]
audio: fix tlv320adc3101 support S24_LE and 16k

PD#146653: fix tlv320adc3101 support S24_LE and 16k

Change-Id: I54daeb69125f83e53164c03b39cfb5c8af742e95
Signed-off-by: Alex Deng <alex.deng@amlogic.com>
7 years agoaudio: tdm fmt set
Xing Wang [Wed, 28 Jun 2017 11:10:02 +0000 (19:10 +0800)]
audio: tdm fmt set

PD#146652: audio: set tdm fmt when hw_param

Change-Id: I5383554d6db58a5dd465c8c65fb974c92b1bac81
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agodts: axg: dtsi update for idle.
Yan Wang [Wed, 28 Jun 2017 07:06:47 +0000 (15:06 +0800)]
dts: axg: dtsi update for idle.

 PD#146619: AXG fail or hard lock up when idle enable.

Change-Id: I688e134f22a1fed67aae98a7a99242c54db5aab7
Signed-off-by: Yan Wang <yan.wang@amlogic.com>
7 years agoaudio: clock only enable in runtime for power consumption
Xing Wang [Tue, 27 Jun 2017 15:22:01 +0000 (23:22 +0800)]
audio: clock only enable in runtime for power consumption

PD#146592: audio: clock only enable in runtime for power consumption

1. clocks for tdm in & out/spdif in & out/pdm in, only enable when runtime
2. remove unused codes

Change-Id: Ic75ab4557b9e1c26fa032a5b14a7a39ae53f6a06
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoaudio: add new audio features
Shuai Li [Wed, 7 Jun 2017 03:41:42 +0000 (20:41 -0700)]
audio: add new audio features

PD#145715: new audio features:
1. mute gpio
2. tas575x driver
3. multi-codec prefix name
4. tlv320adc3101 can revert bclk
5. set clkmsr to check mclk for AXG tdm

Change-Id: Ibd3d9ed8086715439c4bebeb574b998c1ffd1e45
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
7 years agomtd: nand: add slc nand support.
Yonghui Yu [Fri, 23 Jun 2017 08:40:59 +0000 (16:40 +0800)]
mtd: nand: add slc nand support.

PD#142177: mtd: nand: add slc ids.

1. Toshiba 128MB TC58BVG1S3HTA00
2. Spansion 256MB S34ML02G1-MLO2G100BH1OO
3. Spansino 256MB S34ML02G1-MLO2G200BH1OO
4. Mxic 256MB MX30LF2G18AC
5. MXic 512MB MX30LF4G18AC
6. Samsung 512MB K9F4G08U0F
7. Toshiba 512MB TH58NVG2S3HTA

Change-Id: I765cd11cb9c7dd00e5a269e0dc526df536252ff8
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agoclk: axg: add pll disable op [1/1]
Qiufang Dai [Thu, 22 Jun 2017 13:04:50 +0000 (21:04 +0800)]
clk: axg: add pll disable op [1/1]

PD#146411: add disable op for pcie_gp0/hifi pll

1. add clks NULL pointer check.
2. add pll disable op.

Change-Id: Ib32e45e582b45f43b057e1188d83037628c84587
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
7 years agosaradc: refactor the driver based on the iio sub-system
Xingyu Chen [Tue, 14 Mar 2017 03:06:43 +0000 (11:06 +0800)]
saradc: refactor the driver based on the iio sub-system

PD#146222: saradc: refactor the driver based on the iio sub-system

the sar adc driver has been moved from directory input/saradc
into directory iio/adc, and is refactored base on the standard
iio sub-system.

the iio sub-system provide two ways to access sar adc resources:
1. standard api for consumer driver
it can be found at the file "include/linux/iio/consumer.h".

2. sysfs interface for user space(X: 0-7)
  - obtain 10-bit sample value:
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_input

  - obtain raw sample value(10-bit or 12-bit):
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_raw

  - obtain mean raw sample value:
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_mean_raw

test pass on the gxl skt, axg skt, m200.

Change-Id: I6c8877c782c51a01993557cabc0d43f212a8e524
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agousb: fix adb reboot panic.
Yue Wang [Mon, 26 Jun 2017 10:30:44 +0000 (18:30 +0800)]
usb: fix adb reboot panic.

PD#146539: usb: fix adb reboot panic.

Avoid kernel panic caused by race condition. For example,
1. In the ffs_epfile_io function, data buffer is allocated
for non-halt requests and the address of this buffer is
writed to usb controller registers.
2. After adb process be killed, data buffer is freed and
this memory is allocated for the other. But the address
is hold by the controller.
3. Adbd in PC is running. So, the controller receive the
data and write to this memory.
4. The value of this memory is modified by the controller.
This could cause the kernel panic.

To avoid this, during FunctionFS mount, we allocated the
data buffer for requests. And the memory resources has
been released in kill_sb.

Change-Id: I494988e48bb40a21d57adcf38d41c126f9b71978
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agoemmc: refixed error reading dtb character device
Long Yu [Tue, 20 Jun 2017 07:52:54 +0000 (15:52 +0800)]
emmc: refixed error reading dtb character device

PD#146144: emmc: refixed error reading dtb character device

1. corrected the boot0 and boot1 partition property

2. refixed error reading dtb character device

Change-Id: Icebdf35cbd7e779573a16ca0230015c907135d52
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agoge2d: add ge2d driver for axg bringup
Pengcheng Chen [Tue, 6 Jun 2017 05:13:19 +0000 (13:13 +0800)]
ge2d: add ge2d driver for axg bringup

PD#146096: ge2d: add ge2d driver for axg bringup

Change-Id: Iac19fca564ebb564372445c6011143968f2c9739
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoMakefile: fix generation dependency for utsrelease.h
Yixun Lan [Mon, 26 Jun 2017 07:08:24 +0000 (15:08 +0800)]
Makefile: fix generation dependency for utsrelease.h

PD#144946: Makefile: fix generation dependency for utsrelease.h

we need to explicitly generate kernel.release_full first, before
creating utsrelease.h

Change-Id: I9e25d2511026dba8a5d3135468a53340ee3a59de
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agoclk: add saradc clk for gxl
Yun Cai [Fri, 23 Jun 2017 09:49:43 +0000 (17:49 +0800)]
clk: add saradc clk for gxl

PD#146222: add saradc clk for gxl

Change-Id: I5c82dfc4bc44908c10d96056b0d7a0cf3a64c46e
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoPD#145804: vdin: optimize vdin mem & clk control
Dezhi Kong [Mon, 12 Jun 2017 08:43:36 +0000 (16:43 +0800)]
PD#145804: vdin: optimize vdin mem & clk control

Change-Id: I08c96702a1c5716393907f311be2f9b9f6b5c8cd
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
7 years agodts: axg: add D604 mic board led driver
Liang Zhao [Fri, 26 May 2017 12:01:26 +0000 (20:01 +0800)]
dts: axg: add D604 mic board led driver

PD#142470: add D604 mic board led driver

Change-Id: I81dd8ac3f46e0b0cbec6409328489a72d11c54ac
Signed-off-by: Liang Zhao <liang.zhao@amlogic.com>
7 years agoMakefile: generate kernel_full in seperate command
Yixun Lan [Fri, 23 Jun 2017 01:13:51 +0000 (09:13 +0800)]
Makefile: generate kernel_full in seperate command

PD#144946: Makefile: generate kernel_full in seperate command

in certain cases/system, echo command will refuse to interpret backslash
without the '-e' option, so it will end up with one line
"4.9.11\n4.9.11-1234-g1234"

this patch will generate KERNELRELEASE & KERNELRELEASE_FULL in seperate file

Change-Id: I51699f193e893f9ea566251d4440edecf3de7ad8
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agoclk: update for pcie range setting
Yun Cai [Wed, 21 Jun 2017 07:33:01 +0000 (15:33 +0800)]
clk: update for pcie range setting

PD#146333: update for pcie range setting

Change-Id: Ic105ec91bd480ab0d4b980eda90ccbcd1d7baa2c
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agodts: osd: add cma heap for ion
binqi.zhang [Wed, 21 Jun 2017 11:05:11 +0000 (19:05 +0800)]
dts: osd: add cma heap for ion

PD#146107: osd: add cma heap for ion on Android 8.0

Change-Id: I8ebb0c9068a93b9e1bae114a6d5231de5a2ee78f
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
7 years agopwm: revert pwm e and f order
Jian Hu [Wed, 21 Jun 2017 12:39:30 +0000 (20:39 +0800)]
pwm: revert pwm e and f order

PD#146170: pwm: revert pwm e and f order

1.please ask me to get a patch when you are using pwm on axg.
2.new pwm driver is rebuilding.
3.add pwm e and f for axg,actually the hardware not support.

Change-Id: I3222380b700fbe9668c3d2da1dc8d878f22b30aa
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agodts: p212: add vendor & oem partition
Xindong Xu [Thu, 1 Jun 2017 02:44:48 +0000 (10:44 +0800)]
dts: p212: add vendor & oem partition

PD#145255: dts: p212: add vendor & oem partition

Change-Id: I96312e567ef4f5b28740607e091283c70a80578f
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
7 years agoosd: add cma heap for ion
binqi.zhang [Fri, 16 Jun 2017 06:38:58 +0000 (14:38 +0800)]
osd: add cma heap for ion

PD#146107: osd: add cma heap for ion on Android 8.0

Change-Id: Idf4371fd0dceecc883fd8402a656ed7724be1efd
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
7 years agopwm: fix several errors
Jian Hu [Fri, 16 Jun 2017 08:54:56 +0000 (16:54 +0800)]
pwm: fix several errors

PD#144476: pwm: fix pwm driver errors

1.change pwm e and f order
2.fix several errors

you can request like this:

PWM A 0
PWM B 1
PWM C 2
PWM D 3
PWM AO A 4
PWM AO B 5
PWM AO C 6
PWM AO D 7

Change-Id: Ic1ca7d1f0450db748569447140feab9b9d0c5c34
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agoirblaster: add code and dts config for axg
Zan Peng [Mon, 19 Jun 2017 08:31:09 +0000 (16:31 +0800)]
irblaster: add code and dts config for axg

PD#146157: irblaster : add code and dts config for axg
1. default dts config of irblater is disabled

Change-Id: I7cc4eece765d28dcac70e222bd2a36df2ba58183
Signed-off-by: Zan Peng <zan.peng@amlogic.com>
7 years agoMerge "i2c: add auto test i2c master and slave on axg skt." into amlogic-4.9-dev
Jianxin Pan [Tue, 20 Jun 2017 07:32:33 +0000 (00:32 -0700)]
Merge "i2c: add auto test i2c master and slave on axg skt." into amlogic-4.9-dev

7 years agoi2c: add auto test i2c master and slave on axg skt.
Xuhua Zhang [Sat, 17 Jun 2017 11:38:28 +0000 (19:38 +0800)]
i2c: add auto test i2c master and slave on axg skt.

PD#142470: add i2c auto test on axg.

1. if uboot parm(i2c_auto_test) is "open",
   open the i2c auto test function.
2. before the test,we should connect i2c slave and master.

Change-Id: Ia37e080dc7995d31e46c9122b389be1ed21acc63
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
7 years agoamlvideo2: fix screen capture funciton
Guosong Zhou [Mon, 12 Jun 2017 11:09:49 +0000 (19:09 +0800)]
amlvideo2: fix screen capture funciton

PD#145804: fix screen capture function

Change-Id: Icb857a889b53d74cfc85072cc88464fb46d283b3
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
7 years agoclk: add ao clk for axg
Yun Cai [Thu, 18 May 2017 07:01:03 +0000 (15:01 +0800)]
clk: add ao clk for axg

PD#142470: add ao clk saradc for axg

Change-Id: Icadbbf6e631a6158daade2feb4bfae31bed3c471
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agocfg80211: wifi: force to skip cfg80211_leave_all
Lianghu Su [Thu, 15 Jun 2017 07:01:57 +0000 (15:01 +0800)]
cfg80211: wifi: force to skip cfg80211_leave_all

PD#145741: wifi: bcm: fix unable to enter deep suspend mode issue

for the wowlan (wake on wireless lan) function under Linux platfrom,
we have problem to configure it via wpa_supplicant as we do it at Android
platform. so here when it enter into suspend mode, we try to skip calling
cfg80211_leave_all() function at the wire core path.

since this modify the wifi core code, it will also affect other
wifi drivers (not only bcm wifi).

Change-Id: I51eb9b2864afe1bb478ab9411eb7c590f995cd6e
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
7 years agowifi: add pwm configuration for wifi 32k
Jian Hu [Mon, 19 Jun 2017 08:45:35 +0000 (16:45 +0800)]
wifi: add pwm configuration for wifi 32k

PD#146170: wifi: add pwm configuration for wifi 32k

Change-Id: If35f0a495b5b3f9a3ced9cf73ddb0ec7dc1f8ea6
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agolcd: add lcd driver for axg
Evoke Zhang [Fri, 9 Jun 2017 02:46:09 +0000 (10:46 +0800)]
lcd: add lcd driver for axg

PD#142470: lcd: add lcd driver for axg

Change-Id: I58e2a2af474bafbbe3718f51493c9b46cb07cf31
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agomtd: nand: fix oob read pannic.
Yonghui Yu [Thu, 8 Jun 2017 13:00:13 +0000 (21:00 +0800)]
mtd: nand: fix oob read pannic.

PD#145890: nand: fix oob read

When reading oob by nandread from toolbox of andriod,
the oob should be protected. so we read back the whole
page with ecc on, and copy out oob only.

Change-Id: I08f35396015316a35631727dfbfedb862567d913
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agomtd: nand: enhance the robust of env
Yonghui Yu [Wed, 14 Jun 2017 13:19:51 +0000 (21:19 +0800)]
mtd: nand: enhance the robust of env

PD#145594: nand: enhance the robust of env

1)enhance sudden power lost and ecc-error protection
2)add mtd env mutex for kernel

Change-Id: I0a454149c408f882924543d84db5d46591230d3d
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agoosd: add osd driver for axg
Pengcheng Chen [Fri, 5 May 2017 05:48:36 +0000 (13:48 +0800)]
osd: add osd driver for axg

PD#146066: osd: add osd driver for axg bringup

Change-Id: Iea6889046d2a0bd0d7c79f106e4d89ed9828d035
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agopcie: add pcie reset mode.
Yue Wang [Fri, 16 Jun 2017 03:04:35 +0000 (11:04 +0800)]
pcie: add pcie reset mode.

PD#142470: pcie: add pcie reset mode.

Change-Id: I76999754af16890a7c74d0f31978db69b7710191
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agopcie: power on pcie in the probe.
Yue Wang [Tue, 13 Jun 2017 03:05:06 +0000 (11:05 +0800)]
pcie: power on pcie in the probe.

PD#146002: pcie: power on pcie in the probe.

Change-Id: I36ec41c19a7d6bfbe364ddefeaa2c48f181d5d3b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agodts: gxl: disable uart_B
Lianghu Su [Tue, 13 Jun 2017 08:15:50 +0000 (16:15 +0800)]
dts: gxl: disable uart_B

PD#145722: gpio conflict between uart_B and sysled, both of them use
GPIODV_24.

Change-Id: I75ff92b8166244044034a94cd79e4cfc24a39f81
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
7 years agoclk: fix mpll3 jitter too large
Yun Cai [Mon, 12 Jun 2017 09:02:36 +0000 (17:02 +0800)]
clk: fix mpll3 jitter too large

PD#142470: fix mpll3 jitter too large

Change-Id: I106bf9c627a0125ec61ec221d02c0689e547c965
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agopinctrl&gpio: add new interface to set pull-down/up
xingyu.chen [Wed, 7 Jun 2017 08:02:31 +0000 (16:02 +0800)]
pinctrl&gpio: add new interface to set pull-down/up

PD#142470: pinctrl&gpio: add new interface to set pull-down/up

1. add property file 'pull' in directory /sys/class/gpio/gpioX/
pull-up:      echo up > pull
pull-down:    echo down > pull
pull-disable: echo disable > pull

2. add new functions, as follows:
+ gpiod_set_pull(struct gpio_desc *desc, int value)
+ gpiod_set_pull_cansleep(struct gpio_desc *desc, int value)

'value' can be set:
GPIOD_PULL_DIS
GPIOD_PULL_DOWN
GPIOD_PULL_UP

Change-Id: Iba750729288651a897ebac827093ebc6c143f16b
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agovpu: add vpu support for axg
Evoke Zhang [Thu, 11 May 2017 09:13:07 +0000 (17:13 +0800)]
vpu: add vpu support for axg

PD#142470: add vpu support for axg

Change-Id: I9be3f440ac25f09e393544121aa33446ff76ff58
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agopinctrl: fixed some pull configuration errors for gxl/gxm
xingyu.chen [Thu, 8 Jun 2017 09:03:30 +0000 (17:03 +0800)]
pinctrl: fixed some pull configuration errors for gxl/gxm

PD#138714: pinctrl: fixed some pull configuration errors for gxl/gxm

Change-Id: I77db8754c17efcdf139a79086ef9009cb7488929
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agoclkmsr: add special setting for axg audio
Yun Cai [Fri, 26 May 2017 02:23:55 +0000 (10:23 +0800)]
clkmsr: add special setting for axg audio

PD#142470:
1. add special setting for axg audio for AXG
2. update iomap for axg

Change-Id: I1a6ca7bd440aabd1010c854ba0c700b63a105d01
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agopinctrl: avoid requesting the same pin for mux and gpio
xingyu.chen [Mon, 5 Jun 2017 08:16:52 +0000 (16:16 +0800)]
pinctrl: avoid requesting the same pin for mux and gpio

PD#142470: pinctrl: avoid requesting the same pin for mux and gpio

Change-Id: I768aa7d8ffa2792c14c7d932314328d2475c0574
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agoPD#145277: ge2d: export the symbo of the ge2d funs to media modules.
Nanxin Qin [Wed, 31 May 2017 15:59:14 +0000 (23:59 +0800)]
PD#145277: ge2d: export the symbo of the ge2d funs to media modules.

Change-Id: I4e87b8550869ebeb62ab2fe5252601dd7ac9d40e
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
7 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Thu, 8 Jun 2017 02:59:07 +0000 (10:59 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

7 years agoosd: osd support cma, reserved, and ion memory depend on dts config
Pengcheng Chen [Sat, 27 May 2017 03:22:26 +0000 (11:22 +0800)]
osd: osd support cma, reserved, and ion memory depend on dts config

PD#143435: osd support cma, reserved, and ion memory depend on dts config

Change-Id: I79f1a8cebccdb016cee6a6ca54c0356d19fb2657
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agodts: m400: audio: disable i2sclk disable on startup
Peipeng Zhao [Tue, 6 Jun 2017 05:51:58 +0000 (13:51 +0800)]
dts: m400: audio: disable i2sclk disable on startup

PD#141217: audio: fix M400 board noise when device startup

Change-Id: I7030a2648df5e49580d72eaa784fe2c3d0bbdc81
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agopcie: add pcie phy control register access.
Yue Wang [Fri, 2 Jun 2017 07:58:45 +0000 (15:58 +0800)]
pcie: add pcie phy control register access.

PD#142470: pcie: add pcie phy control register access.

Change-Id: I832b05763a722c074980f19682c6249915c0363d
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agodts: axg: add thermal config
Tao Zeng [Wed, 31 May 2017 08:46:05 +0000 (16:46 +0800)]
dts: axg: add thermal config

PD#142470: thermal: enable thermal for axg

1. add thermal node for all axg devices;
2. calculate thermal parameters for all axg device.

Change-Id: I78b7fbe24bfb7910fa52223ade63c93265a6d6e1
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
7 years agounifykey: initial add unifykey driver for m8bb
Jiamin Ma [Wed, 17 May 2017 02:56:23 +0000 (10:56 +0800)]
unifykey: initial add unifykey driver for m8bb

PD#141217: initial add unifykey driver for m8bb

known issues:
1. do not support efuse mode for key storage
2. do not support nand key storage
3. do not suppot unifykey ops in multi-thread env
changelists:
1. use internal sha apis
how to use:
su
cd /sys/class/unifykeys
echo 1 > attach
echo mac > name
echo 001122 > write
echo mac > name
cat read

Change-Id: I0586f1a41ded72553afe3cc4cc199dbc4b563bf1
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agopinctrl: fix some errors and add new function groups for gxl/gxm
xingyu.chen [Thu, 1 Jun 2017 07:52:40 +0000 (15:52 +0800)]
pinctrl: fix some errors and add new function groups for gxl/gxm

PD#138714: pinctrl: fix some errors and add new function groups

Change-Id: I25a99b8715d22c887f07f0cbbbe5b9a3ba42f927
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agonand: enable 8 copies bl2 for axg by default[3/3]
Yonghui Yu [Mon, 5 Jun 2017 04:45:41 +0000 (12:45 +0800)]
nand: enable 8 copies bl2 for axg by default[3/3]

PD#145459: nand: write 8 copies info-page for axg by default

Change-Id: Id53907f6219678a73581ac9725721d5795993051
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agodtsi: axg: add remote config
Zan Peng [Mon, 5 Jun 2017 12:37:57 +0000 (20:37 +0800)]
dtsi: axg: add remote config

PD#142470: dtsi: axg add remote config

Change-Id: Idb10aea3385d5f48f89fe0dd9fa8c76d4bb49fac
Signed-off-by: Zan Peng <zan.peng@amlogic.com>
7 years agopinctrl: add TEST_N and GPIOCLK bank pins support
xingyu.chen [Thu, 1 Jun 2017 06:07:23 +0000 (14:07 +0800)]
pinctrl: add TEST_N and GPIOCLK bank pins support

PD#142470: pinctrl: add TEST_N and GPIOCK bank pins support

1. add TEST_N pin support for axg and gxl/gxm
2. add GPIOCLK bank pins support for gxl/gxm

Change-Id: I8248ffe94b883a38f971ce07910258602b488cf2
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agodts: S400: change tdm-b for audio capture
Peipeng Zhao [Fri, 26 May 2017 09:43:37 +0000 (17:43 +0800)]
dts: S400: change tdm-b for audio capture

PD#145484: audio: support snd_soc_dai_set_sysclk for mutli codec

Change-Id: I3a2e24e1321e9251029e0abe79e97a9852a68450
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agoaudio: add pcm186x, ssm3515, ssm3525 codec driver
Peipeng Zhao [Fri, 12 May 2017 10:38:18 +0000 (18:38 +0800)]
audio: add pcm186x, ssm3515, ssm3525 codec driver

PD#145486: audio: add codec driver

Change-Id: Ief27ff9892ffabba81f676f4bed2ec6b4ead74f5
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agodts: m400: add wifi/bt config
Peipeng Zhao [Fri, 2 Jun 2017 10:39:17 +0000 (18:39 +0800)]
dts: m400: add wifi/bt config

PD#141217: add wifi/bt config on dts for board M400

Change-Id: I241607a40ab2341748b22072806f744c7a24f873
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agosdio: slove sdio & emmc dealocks on m8b
Nan Li [Tue, 23 May 2017 07:03:35 +0000 (15:03 +0800)]
sdio: slove sdio & emmc dealocks on m8b

PD#141217: slove sdio & emmc dealocks on m8b.
1) Add a semaphore to avoid emmc deadlocks occur and sdio
when they shared the same controller.
2) remove sd ro of dts.
3) add m400 dts support.

Change-Id: I5fe0a76517a341313513e5abdbc16366724cbbe9
Signed-off-by: Nan Li <nan.li@amlogic.com>
7 years agoaudio: enable pdm module firstly
Xing Wang [Fri, 2 Jun 2017 12:32:15 +0000 (20:32 +0800)]
audio: enable pdm module firstly

PD#142470: audio: ensure pdm module enable firstly
1) Ensure pdm clk and module enable firstly
2) add control that hcic shift gain would be fixed with coeff

Change-Id: I9c0dd7cf0e36d2e653c3f593c853f5d14d1dfdcf
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoaudio: add tdm lanemask config
Shuai Li [Mon, 5 Jun 2017 00:37:30 +0000 (17:37 -0700)]
audio: add tdm lanemask config

PD#142470: audio: add lanesmask

Change-Id: I56d01ff4f77c90c4fb5575fc654b3459fec1ed14
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
7 years agosecurity: arm: meson: add tee support [2/2]
Peifu Jiang [Wed, 24 May 2017 10:34:15 +0000 (18:34 +0800)]
security: arm: meson: add tee support [2/2]

PD#145094: security: arm: meson: add tee support

Change-Id: I8789ef2b6d774abb6252e60c0726e7384127339f
Signed-off-by: Peifu Jiang <peifu.jiang@amlogic.com>
7 years agoemmc: add emmc HS400 function
Long Yu [Fri, 19 May 2017 01:54:22 +0000 (09:54 +0800)]
emmc: add emmc HS400 function

PD#142470: emmc: support hs400 busmode

1. refix source clock 400MHZ
2. add hs400 timming function

Change-Id: I9cc767262379ba2be5ab5d3e68aae87c1f18c242
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agodts: axg: s400,s420: support uart bt
Weiguang Ruan [Tue, 23 May 2017 04:14:34 +0000 (12:14 +0800)]
dts: axg: s400,s420: support uart bt

PD#142470: bt: add s400 & s420 uart bt support

1. add bt power enable configuration: bt-dev
2. enable uart_a
3. add cts rts pin mux for uart_a

Change-Id: I96bbb3c885da3c860bc1015b2b33971ee9740b26
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
7 years agoaudio: add asoc auge driver for axg
Xing Wang [Tue, 30 May 2017 13:22:31 +0000 (21:22 +0800)]
audio: add asoc auge driver for axg

PD#142470: audio: new Asoc driver
1) tdm module
2) spdif module
3) pdm module
4) audio clock

Change-Id: I064975f4cb036d013a7ca74d781a91c31e7c2436
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoBACKPORT [FROMLIST] New getsockopt option to get socket cookie
Chenbo Feng [Thu, 6 Apr 2017 02:00:55 +0000 (19:00 -0700)]
BACKPORT [FROMLIST] New getsockopt option to get socket cookie

Cherry-pick from linux net-next branch commit
http://patchwork.ozlabs.org/patch/747590/

Introduce a new getsockopt operation to retrieve the socket cookie
for a specific socket based on the socket fd.  It returns a unique
non-decreasing cookie for each socket.
Tested: https://android-review.googlesource.com/#/c/358163/

Test: Unit test added in kernel/tests

Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Chenbo Feng <fengc@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoUPSTREAM: bpf: cgroup: fix documentation of __cgroup_bpf_update()
Daniel Mack [Mon, 28 Nov 2016 13:11:04 +0000 (14:11 +0100)]
UPSTREAM: bpf: cgroup: fix documentation of __cgroup_bpf_update()

There's a 'not' missing in one paragraph. Add it.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reported-by: Rami Rosen <roszenrami@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
       ("cgroup: add support for eBPF programs")
(cherry picked from commit 01ae87eab53675cbdabd5c4d727c4a35e397cce0)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoBACKPORT: bpf: introduce BPF_F_ALLOW_OVERRIDE flag
Alexei Starovoitov [Sat, 11 Feb 2017 04:28:24 +0000 (20:28 -0800)]
BACKPORT: bpf: introduce BPF_F_ALLOW_OVERRIDE flag

If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command
to the given cgroup the descendent cgroup will be able to override
effective bpf program that was inherited from this cgroup.
By default it's not passed, therefore override is disallowed.

Examples:
1.
prog X attached to /A with default
prog Y fails to attach to /A/B and /A/B/C
Everything under /A runs prog X

2.
prog X attached to /A with allow_override.
prog Y fails to attach to /A/B with default (non-override)
prog M attached to /A/B with allow_override.
Everything under /A/B runs prog M only.

3.
prog X attached to /A with allow_override.
prog Y fails to attach to /A with default.
The user has to detach first to switch the mode.

In the future this behavior may be extended with a chain of
non-overridable programs.

Also fix the bug where detach from cgroup where nothing is attached
was not throwing error. Return ENOENT in such case.

Add several testcases and adjust libbpf.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
       ("cgroup: add support for eBPF programs")
[AmitP: Refactored original patch for android-4.9 where libbpf sources
        are in samples/bpf/ and test_cgrp2_attach2, test_cgrp2_sock,
        and test_cgrp2_sock2 sample tests do not exist.]
(cherry picked from commit 7f677633379b4abb3281cdbe7e7006f049305c03)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: bpf: restore skb->sk before pskb_trim() call
Eric Dumazet [Wed, 26 Apr 2017 16:09:23 +0000 (09:09 -0700)]
UPSTREAM: bpf: restore skb->sk before pskb_trim() call

While testing a fix [1] in ___pskb_trim(), addressing the WARN_ON_ONCE()
in skb_try_coalesce() reported by Andrey, I found that we had an skb
with skb->sk set but no skb->destructor.

This invalidated heuristic found in commit 158f323b9868 ("net: adjust
skb->truesize in pskb_expand_head()") and in cited patch.

Considering the BUG_ON(skb->sk) we have in skb_orphan(), we should
restrain the temporary setting to a minimal section.

[1] https://patchwork.ozlabs.org/patch/755570/
    net: adjust skb->truesize in ___pskb_trim()

Fixes: 8f917bba0042 ("bpf: pass sk to helper functions")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: Ifcbcbe2ab2882dc79c56f9707be1d6aef08c7fd3
       ("BACKPORT: UPSTREAM: bpf: pass sk to helper functions")
(cherry picked from commit d1f496fd8f34a40458d0eda6be0655926559e546)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: cgroup: move CONFIG_SOCK_CGROUP_DATA to init/Kconfig
Arnd Bergmann [Tue, 10 Jan 2017 12:08:06 +0000 (13:08 +0100)]
UPSTREAM: cgroup: move CONFIG_SOCK_CGROUP_DATA to init/Kconfig

We now 'select SOCK_CGROUP_DATA' but Kconfig complains that this is
not right when CONFIG_NET is disabled and there is no socket interface:

warning: (CGROUP_BPF) selects SOCK_CGROUP_DATA which has unmet direct dependencies (NET)

I don't know what the correct solution for this is, but simply removing
the dependency on NET from SOCK_CGROUP_DATA by moving it out of the
'if NET' section avoids the warning and does not produce other build
errors.

Fixes: 483c4933ea09 ("cgroup: Fix CGROUP_BPF config")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: Ib41ef78fba02eb9e592558ddbf06f9ec0aa337b6
       ("UPSTREAM: cgroup: Fix CGROUP_BPF config")
(cherry picked from commit 73b351473547e543e9c8166dd67fd99c64c15b0b)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: cgroup, bpf: remove unnecessary #include
Alexei Starovoitov [Wed, 30 Nov 2016 18:16:08 +0000 (10:16 -0800)]
UPSTREAM: cgroup, bpf: remove unnecessary #include

this #include is unnecessary and brings whole set of
other headers into cgroup-defs.h. Remove it.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Rami Rosen <roszenrami@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
       ("cgroup: add support for eBPF programs")
(cherry picked from commit b634d30a79ecc2d28e61cbe5b1f4443952f37a8f)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoANDROID: mnt: Fix next_descendent
Daniel Rosenberg [Mon, 29 May 2017 23:38:16 +0000 (16:38 -0700)]
ANDROID: mnt: Fix next_descendent

next_descendent did not properly handle the case
where the initial mount had no slaves. In this case,
we would look for the next slave, but since don't
have a master, the check for wrapping around to the
start of the list will always fail. Instead, we check
for this case, and ensure that we end the iteration
when we come back to the root.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 62094374
Change-Id: I43dfcee041aa3730cb4b9a1161418974ef84812e

7 years agodts: s420; remove ethmac config
Alex Deng [Sat, 27 May 2017 14:06:28 +0000 (22:06 +0800)]
dts: s420; remove ethmac config

PD#142470: eth: A113x no eth

Change-Id: I39ee67276a4126b7ecf741285d1b5129eb12cf4b
Signed-off-by: Alex Deng <alex.deng@amlogic.com>
7 years agowifi: meson64: support ath10k pcie wifi and sdio wifi in s400/s420
Weiguang Ruan [Tue, 16 May 2017 14:32:52 +0000 (22:32 +0800)]
wifi: meson64: support ath10k pcie wifi and sdio wifi in s400/s420

PD#142470: wifi
1. add ath10k driver compile as module
add cfg80211_wext_compat to support wext command.

CONFIG_CFG80211_WEXT=y
CONFIG_ATH_COMMON=m
CONFIG_ATH10K=m
CONFIG_ATH10K_PCI=m

2. fix wifi enalbe & irq pin num
3. add pwm config for 32k
4. add 32k pin mux

Change-Id: I71872ceef147b6cc49a76bce837a9aff0d5be66f
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agodts: add watchdog support for axg
Bo Yang [Tue, 9 May 2017 06:54:08 +0000 (14:54 +0800)]
dts: add watchdog support for axg

PD#142470: dts: add watchdog support for axg

Default disable watchdog.

Change-Id: I1d314594eff9773d04aeb4943a4e89604c35f100
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
7 years agoeth: add ethernet function for axg
Yizhou Jiang [Wed, 17 May 2017 02:33:14 +0000 (10:33 +0800)]
eth: add ethernet function for axg

PD#142470: eth: add ethernet for axg

1.for external phy
2.not set regs that did not exist in axg

Change-Id: I4d9f8732f35a0e9e605f1a4a4a9a0285236e705f
Signed-off-by: Yizhou Jiang <yizhou.jiang@amlogic.com>
7 years agopinctrl: add enable interface for gpio request
xingyu.chen [Thu, 18 May 2017 04:48:38 +0000 (12:48 +0800)]
pinctrl: add enable interface for gpio request

PD#142470: pinctrl and fix tas5707 reset pin
1. add enable interface for gpio request
mux register be set '0x0' when pin requested as gpio
2. fix reset pin of gpio ao in dts.
3. fix gpio ctl when no reset pin defined in dts

Change-Id: I866d29a96025811b1d0436eb5d157e4dff1ff7ca
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
Signed-off-by: Alex Deng <alex.deng@amlogic.com>
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoemmc/sdio: support emmc/sdio driver for new host controller
Long Yu [Tue, 16 May 2017 15:26:41 +0000 (23:26 +0800)]
emmc/sdio: support emmc/sdio driver for new host controller

PD#142470: emmc/sdio: support emmc/sdio driver for new host controller
1. add emmc support
2. support emmc DDR52 Busmode
3. add sdio support
4: axg_s400: disabled emmc function

Change-Id: Iaccca580393477f0ad96e7638dfa4d9e2809c37d
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agodts: all uart dts setting [1/1]
Qi Duan [Mon, 15 May 2017 09:48:40 +0000 (17:48 +0800)]
dts: all uart dts setting [1/1]

PD#142470: all uart dts setting

all uart node added.default is disable
If want to enable, 1. status = okay 2.set the right pinmux

Change-Id: I744db5735212f3a3217a4b9e26f4ebe074aa5bdc
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agonand: update config for mtd driver
Yonghui Yu [Mon, 15 May 2017 03:49:39 +0000 (11:49 +0800)]
nand: update config for mtd driver

PD#142470: update nand config for mtd
1. update dts of skt&s400
2. update clock reg
3. update regbase
4. update bchmode for infopage
5. mtd: support desctrete uboot layout for slc
   change uboot layout for slc [3/3]

multi bootloaders were stored in mlc/slc/emmc.

For emmc/mlc, there's enough space at the begining.
bl2&fip can be stored together which we may call it
as compact mode.
    |bl2|fip|bl2|fip|bl2|fip|rsv|normal|

But for slc, space is restricted by romboot. bl2 and
fip had to be stored discretely.
    |bl2|bl2|bl2|bl2|rsv|fip|fip|fip|fip|normal|

If kernle want mtd driver use descrete mode.
1. bl_mode in dts should be set as 1.
2. fip_copies and fip_size should be the same as uboot which
   was described by marco CONFIG_TPL_COPY_NUM&CONFIG_TPL_SIZE_PER_COPY.
3. And the tpl partition should be added in mtd partition table whose
    offset and size are negligible.

when using, mtd0 is for bl2, mtd1 is for tpl(fip)

Change-Id: I0ed07168ba7497d674a7160f7966ebb484a123d5
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agoMakefile: lock kernel version without localversion appended
Yixun Lan [Thu, 25 May 2017 04:27:15 +0000 (12:27 +0800)]
Makefile: lock kernel version without localversion appended

PD#144946: Makefile: lock kernel version without localversion appended

after this change, we will lock kernel version to 4.x.y
but we can still get out the exact commit version from dmesg.

1) uname -r : 4.9.27
2) dmesg |grep "Linux version"
  [    0.000000@0] Linux version 4.9.27-638106-g5de5d7a  ....

Change-Id: I35072b399af403d3a1737300a8786cf36063c668
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agospicc: add spicc driver for axg
Sunny Luo [Fri, 5 May 2017 12:45:58 +0000 (20:45 +0800)]
spicc: add spicc driver for axg

PD#142470: add spicc driver for axg and fix spicc-b
interrupt number error

Change-Id: Ibbda6d8526c4141992fcbe307d6f1e0fbc570cfe
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
7 years agousb: dts: set otg switch for board axg
Yue Wang [Fri, 12 May 2017 06:52:39 +0000 (14:52 +0800)]
usb: dts: set otg switch for board axg

PD#142470: set otg switch for board axg

Change-Id: I97500402a2747910d82b9928a55419d35ce2f826
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agopcie: add pcie driver for axg
Yue Wang [Fri, 12 May 2017 01:55:03 +0000 (09:55 +0800)]
pcie: add pcie driver for axg

PD#142470: add pcie driver for axg
1. update dts of skt&s400
2. update pcie driver

Change-Id: Ic569e8fed1a4434e54847580299703f0fe07cd9b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agoclk: update clk for axg
Yun Cai [Fri, 5 May 2017 06:41:21 +0000 (14:41 +0800)]
clk: update clk for axg

PD#142470:
1. add amlogic,axg-clkc.h for mesonaxg.dtsi
and fix clkc reg value
2. update pcie and hifi pll setting for axg

PD#142470: update hifi pll setting for axg

Change-Id: I34aac4ead8384e6a150ae8630034c247f53ac27a
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agocrypto: sha driver update
Matthew Shyu [Fri, 31 Mar 2017 10:33:40 +0000 (18:33 +0800)]
crypto: sha driver update

PD#142470: crypto: sha driver update for txlx and beyond

Change-Id: Ia5eb0c1750bedd0894e3db1e7f0796de23cce1dd
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
7 years agoi2c: add i2c support for axg
Xuhua Zhang [Thu, 11 May 2017 11:18:13 +0000 (19:18 +0800)]
i2c: add i2c support for axg

PD#142470: i2c: add i2c support fot axg and fix i2c_ao error on axg

Change-Id: I15c00bc5833dd10c94562e939c6b53d0138ac231
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
7 years agopwm: add pwm support for axg
Jian Hu [Fri, 5 May 2017 06:04:24 +0000 (14:04 +0800)]
pwm: add pwm support for axg

PD#142470: pwm: add pwm support fot axg

the pwm groups's addresses are the same with txlx,
just add several macros to support axg.

Change-Id: Iaefa3c2a31fc8f43e4dc80448c6548c2df62fa8f
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agodts: add dts for A113D socket and development boards
Yun Cai [Sat, 27 May 2017 06:06:57 +0000 (14:06 +0800)]
dts: add dts for A113D socket and development boards

PD#142470: add axg_a113d_skt.dts axg_s400.dts and axg_s420.dts

Change-Id: If8c5b1e0fa5b6a21a91ce1323fa1107d608c4af7
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoMerge 4.9.30 into android-4.9
Greg Kroah-Hartman [Thu, 25 May 2017 15:32:43 +0000 (17:32 +0200)]
Merge 4.9.30 into android-4.9

Changes in 4.9.30
usb: misc: legousbtower: Fix buffers on stack
usb: misc: legousbtower: Fix memory leak
USB: ene_usb6250: fix DMA to the stack
watchdog: pcwd_usb: fix NULL-deref at probe
char: lp: fix possible integer overflow in lp_setup()
USB: core: replace %p with %pK
tpm_tis_core: Choose appropriate timeout for reading burstcount
ALSA: hda: Fix cpu lockup when stopping the cmd dmas
ARM: tegra: paz00: Mark panel regulator as enabled on boot
fanotify: don't expose EOPENSTALE to userspace
tpm_tis_spi: Use single function to transfer data
tpm_tis_spi: Abort transfer when too many wait states are signaled
tpm_tis_spi: Check correct byte for wait state indicator
tpm_tis_spi: Remove limitation of transfers to MAX_SPI_FRAMESIZE bytes
tpm_tis_spi: Add small delay after last transfer
tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver
tpm: add sleep only for retry in i2c_nuvoton_write_status()
tpm_crb: check for bad response size
ASoC: cs4271: configure reset GPIO as output
mlx5: Fix mlx5_ib_map_mr_sg mr length
infiniband: call ipv6 route lookup via the stub interface
dm btree: fix for dm_btree_find_lowest_key()
dm raid: select the Kconfig option CONFIG_MD_RAID0
dm bufio: avoid a possible ABBA deadlock
dm bufio: check new buffer allocation watermark every 30 seconds
dm mpath: split and rename activate_path() to prepare for its expanded use
dm cache metadata: fail operations if fail_io mode has been established
dm bufio: make the parameter "retain_bytes" unsigned long
dm thin metadata: call precommit before saving the roots
dm space map disk: fix some book keeping in the disk space map
md: update slab_cache before releasing new stripes when stripes resizing
md: MD_CLOSING needs to be cleared after called md_set_readonly or do_md_stop
rtlwifi: rtl8821ae: setup 8812ae RFE according to device type
mwifiex: MAC randomization should not be persistent
mwifiex: pcie: fix cmd_buf use-after-free in remove/reset
ima: accept previously set IMA_NEW_FILE
KVM: x86: Fix load damaged SSEx MXCSR register
KVM: x86: Fix potential preemption when get the current kvmclock timestamp
KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation
x86: fix 32-bit case of __get_user_asm_u64()
regulator: rk808: Fix RK818 LDO2
regulator: tps65023: Fix inverted core enable logic.
s390/kdump: Add final note
s390/cputime: fix incorrect system time
ath9k_htc: Add support of AirTies 1eda:2315 AR9271 device
ath9k_htc: fix NULL-deref at probe
drm/amdgpu: Make display watermark calculations more accurate
drm/amdgpu: Avoid overflows/divide-by-zero in latency_watermark calculations.
drm/amdgpu: Add missing lb_vblank_lead_lines setup to DCE-6 path.
drm/nouveau/therm: remove ineffective workarounds for alarm bugs
drm/nouveau/tmr: ack interrupt before processing alarms
drm/nouveau/tmr: fix corruption of the pending list when rescheduling an alarm
drm/nouveau/tmr: avoid processing completed alarms when adding a new one
drm/nouveau/tmr: handle races with hw when updating the next alarm time
gpio: omap: return error if requested debounce time is not possible
cdc-acm: fix possible invalid access when processing notification
ohci-pci: add qemu quirk
cxl: Force context lock during EEH flow
cxl: Route eeh events to all drivers in cxl_pci_error_detected()
proc: Fix unbalanced hard link numbers
of: fix sparse warning in of_pci_range_parser_one
of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes()
of: fdt: add missing allocation-failure check
ibmvscsis: Do not send aborted task response
iio: dac: ad7303: fix channel description
IIO: bmp280-core.c: fix error in humidity calculation
IB/hfi1: Return an error on memory allocation failure
IB/hfi1: Fix a subcontext memory leak
pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes
pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()
USB: serial: ftdi_sio: fix setting latency for unprivileged users
USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs
USB: chaoskey: fix Alea quirk on big-endian hosts
f2fs: check entire encrypted bigname when finding a dentry
fscrypt: avoid collisions when presenting long encrypted filenames
libnvdimm: fix clear length of nvdimm_forget_poison()
xhci: remove GFP_DMA flag from allocation
usb: host: xhci-plat: propagate return value of platform_get_irq()
xhci: apply PME_STUCK_QUIRK and MISSING_CAS quirk for Denverton
usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
net: irda: irda-usb: fix firmware name on big-endian hosts
usbvision: fix NULL-deref at probe
mceusb: fix NULL-deref at probe
ttusb2: limit messages to buffer size
dvb-usb-dibusb-mc-common: Add MODULE_LICENSE
usb: dwc3: gadget: Prevent losing events in event cache
usb: musb: tusb6010_omap: Do not reset the other direction's packet size
usb: musb: Fix trying to suspend while active for OTG configurations
USB: iowarrior: fix info ioctl on big-endian hosts
usb: serial: option: add Telit ME910 support
USB: serial: qcserial: add more Lenovo EM74xx device IDs
USB: serial: mct_u232: fix big-endian baud-rate handling
USB: serial: io_ti: fix div-by-zero in set_termios
USB: hub: fix SS hub-descriptor handling
USB: hub: fix non-SS hub-descriptor handling
ipx: call ipxitf_put() in ioctl error path
iio: proximity: as3935: fix as3935_write
iio: hid-sensor: Store restore poll and hysteresis on S3
s5p-mfc: Fix race between interrupt routine and device functions
gspca: konica: add missing endpoint sanity check
s5p-mfc: Fix unbalanced call to clock management
dib0700: fix NULL-deref at probe
zr364xx: enforce minimum size when reading header
dvb-frontends/cxd2841er: define symbol_rate_min/max in T/C fe-ops
digitv: limit messages to buffer size
dw2102: limit messages to buffer size
cx231xx-audio: fix init error path
cx231xx-audio: fix NULL-deref at probe
cx231xx-cards: fix NULL-deref at probe
powerpc/mm: Ensure IRQs are off in switch_mm()
powerpc/eeh: Avoid use after free in eeh_handle_special_event()
powerpc/book3s/mce: Move add_taint() later in virtual mode
powerpc/pseries: Fix of_node_put() underflow during DLPAR remove
powerpc/iommu: Do not call PageTransHuge() on tail pages
powerpc/64e: Fix hang when debugging programs with relocated kernel
powerpc/tm: Fix FP and VMX register corruption
arm64: KVM: Do not use stack-protector to compile EL2 code
arm: KVM: Do not use stack-protector to compile HYP code
KVM: arm: plug potential guest hardware debug leakage
ARM: 8662/1: module: split core and init PLT sections
ARM: 8670/1: V7M: Do not corrupt vector table around v7m_invalidate_l1 call
ARM: dts: at91: sama5d3_xplained: fix ADC vref
ARM: dts: at91: sama5d3_xplained: not all ADC channels are available
ARM: dts: imx6sx-sdb: Remove OPP override
arm64: dts: hi6220: Reset the mmc hosts
arm64: xchg: hazard against entire exchange variable
arm64: ensure extension of smp_store_release value
arm64: armv8_deprecated: ensure extension of addr
arm64: uaccess: ensure extension of access_ok() addr
arm64: documentation: document tagged pointer stack constraints
staging: rtl8192e: rtl92e_fill_tx_desc fix write to mapped out memory.
staging: rtl8192e: fix 2 byte alignment of register BSSIDR.
staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD.
staging: rtl8192e: GetTs Fix invalid TID 7 warning.
iommu/vt-d: Flush the IOTLB to get rid of the initial kdump mappings
metag/uaccess: Fix access_ok()
metag/uaccess: Check access_ok in strncpy_from_user
stackprotector: Increase the per-task stack canary's random range from 32 bits to 64 bits on 64-bit platforms
uwb: fix device quirk on big-endian hosts
genirq: Fix chained interrupt data ordering
nvme: unmap CMB and remove sysfs file in reset path
MIPS: Loongson-3: Select MIPS_L1_CACHE_SHIFT_6
osf_wait4(): fix infoleak
um: Fix to call read_initrd after init_bootmem
tracing/kprobes: Enforce kprobes teardown after testing
PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC
PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs
PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
PCI: Fix another sanity check bug in /proc/pci mmap
PCI: Only allow WC mmap on prefetchable resources
PCI: Freeze PME scan before suspending devices
mtd: nand: orion: fix clk handling
mtd: nand: omap2: Fix partition creation via cmdline mtdparts
mtd: nand: add ooblayout for old hamming layout
drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
NFSv4: Fix a hang in OPEN related to server reboot
NFS: Fix use after free in write error path
NFS: Use GFP_NOIO for two allocations in writeback
nfsd: fix undefined behavior in nfsd4_layout_verify
nfsd: encoders mustn't use unitialized values in error cases
drivers: char: mem: Check for address space wraparound with mmap()
drm/i915/gvt: Disable access to stolen memory as a guest
Linux 4.9.30

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
7 years agoLinux 4.9.30 v4.9.30
Greg Kroah-Hartman [Thu, 25 May 2017 13:45:05 +0000 (15:45 +0200)]
Linux 4.9.30

7 years agodrm/i915/gvt: Disable access to stolen memory as a guest
Chris Wilson [Wed, 9 Nov 2016 10:39:05 +0000 (10:39 +0000)]
drm/i915/gvt: Disable access to stolen memory as a guest

commit 04a68a35ce6d7b54749989f943993020f48fed62 upstream.

Explicitly disable stolen memory when running as a guest in a virtual
machine, since the memory is not mediated between clients and reserved
entirely for the host. The actual size should be reported as zero, but
like every other quirk we want to tell the user what is happening.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99028
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161109103905.17860-1-chris@chris-wilson.co.uk
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers: char: mem: Check for address space wraparound with mmap()
Julius Werner [Fri, 12 May 2017 21:42:58 +0000 (14:42 -0700)]
drivers: char: mem: Check for address space wraparound with mmap()

commit b299cde245b0b76c977f4291162cf668e087b408 upstream.

/dev/mem currently allows mmap() mappings that wrap around the end of
the physical address space, which should probably be illegal. It
circumvents the existing STRICT_DEVMEM permission check because the loop
immediately terminates (as the start address is already higher than the
end address). On the x86_64 architecture it will then cause a panic
(from the BUG(start >= end) in arch/x86/mm/pat.c:reserve_memtype()).

This patch adds an explicit check to make sure offset + size will not
wrap around in the physical address type.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfsd: encoders mustn't use unitialized values in error cases
J. Bruce Fields [Fri, 5 May 2017 20:17:57 +0000 (16:17 -0400)]
nfsd: encoders mustn't use unitialized values in error cases

commit f961e3f2acae94b727380c0b74e2d3954d0edf79 upstream.

In error cases, lgp->lg_layout_type may be out of bounds; so we
shouldn't be using it until after the check of nfserr.

This was seen to crash nfsd threads when the server receives a LAYOUTGET
request with a large layout type.

GETDEVICEINFO has the same problem.

Reported-by: Ari Kauppi <Ari.Kauppi@synopsys.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfsd: fix undefined behavior in nfsd4_layout_verify
Ari Kauppi [Fri, 5 May 2017 20:07:55 +0000 (16:07 -0400)]
nfsd: fix undefined behavior in nfsd4_layout_verify

commit b550a32e60a4941994b437a8d662432a486235a5 upstream.

  UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
  shift exponent 128 is too large for 32-bit type 'int'

Depending on compiler+architecture, this may cause the check for
layout_type to succeed for overly large values (which seems to be the
case with amd64). The large value will be later used in de-referencing
nfsd4_layout_ops for function pointers.

Reported-by: Jani Tuovila <tuovila@synopsys.com>
Signed-off-by: Ari Kauppi <ari@synopsys.com>
[colin.king@canonical.com: use LAYOUT_TYPE_MAX instead of 32]
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Use GFP_NOIO for two allocations in writeback
Benjamin Coddington [Wed, 19 Apr 2017 14:11:33 +0000 (10:11 -0400)]
NFS: Use GFP_NOIO for two allocations in writeback

commit ae97aa524ef495b6276fd26f5d5449fb22975d7c upstream.

Prevent a deadlock that can occur if we wait on allocations
that try to write back our pages.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: 00bfa30abe869 ("NFS: Create a common pgio_alloc and pgio_release...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Fix use after free in write error path
Fred Isaman [Fri, 14 Apr 2017 18:24:28 +0000 (14:24 -0400)]
NFS: Fix use after free in write error path

commit 1f84ccdf37d0db3a70714d02d51b0b6d45887fb8 upstream.

Signed-off-by: Fred Isaman <fred.isaman@gmail.com>
Fixes: 0bcbf039f6b2b ("nfs: handle request add failure properly")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>