Commit Graph

649320 Commits

Author SHA1 Message Date
Long Yu
944c610889 emmc: Set a flag when all sampling points are valid [1/1]
PD#SWPL-12209

Problem:
fixed SWPL-11917
When all the sample points are valid,
they fall into the changes of 111917

Solution:
flag is set when all sampling points are valid
so tuning does not enter the changes of 11197

Verify:
txlx

Change-Id: I591993f3007db913b0030b108dcb18c304bf1042
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:23 +09:00
Nan Li
908c0167f8 sd: optimize sduart not supported flag [1/1]
PD#SWPL-4858

Problem:
Soc not support sduart

Solution:
add not supported flag in dts

Verify:
verify by tl1 skt

Change-Id: Ifd1f975bd13b150aac9d99f60423ab4f0b903c98
Signed-off-by: Nan Li <nan.li@amlogic.com>
2020-06-29 11:45:23 +09:00
ruixuan.li
239d8db2c1 tm2: make emmc run high speed [1/1]
PD#SWPL-5658

Problem:
emmc run hs200 report cmd18 rx data crc

Solution:
emmc run high speed first

Verify:
passed on t962e2_ab319

Change-Id: Iaeef33e38f7c5130ebfd0e7c5886459b8138a803
Signed-off-by: ruixuan.li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/mesontm2.dtsi
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
	arch/arm64/boot/dts/amlogic/mesontm2.dtsi
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
2020-06-29 11:45:23 +09:00
Qiang Li
441d225410 sdcard: sm1: add sdcard support. [1/2]
PD#SWPL-5409

Problem:
sm1 sdcard failed.

Solution:
change sm1 sdcard high speed mode co_phase.

Verify:
SM1_AC200

Change-Id: I295c6fac2594e611bf278f83a97bb503fb8bb13b
Signed-off-by: Qiang Li <qiang.li@amlogic.com>
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/sm1_pxp.dts
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm/boot/dts/amlogic/sm1_s905d3_skt.dts
	arch/arm64/boot/dts/amlogic/sm1_pxp.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_skt.dts
	drivers/amlogic/mmc/aml_sd_emmc.c
2020-06-29 11:45:23 +09:00
ruixuan.li
480564fb45 tm2: emmc run hs400 200M [1/1]
PD#SWPL-5658

Problem:
emmc run hs200 200M now

Solution:
set emmc busmode to hs400 200M

Verify:
passed on t962e2 ab311

Change-Id: If5fef5c3b55cc95152b0d5d19bb5a56b293aafcf
Signed-off-by: ruixuan.li <ruixuan.li@amlogic.com>
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/sm1_s905x3_ac213.dts
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
	arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts
	arch/arm64/boot/dts/amlogic/sm1_s905x3_ac213.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
	arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts
2020-06-29 11:45:23 +09:00
Ruixuan Li
e2b93503cd emmc: run hs400 200M on sm1 [1/1]
PD#SWPL-5404

Problem:
run hs400 200M on sm1

Solution:
config sm1 and modify dts

Verify:
passed on ac200

Change-Id: I34e54f88db79ce42f9effbf8d673ade613de328f
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200.dts
2020-06-29 11:45:23 +09:00
Long Yu
04c8f997a1 emmc: modified the fixed adj tuning mode for HS200 [1/1]
PD#SWPL-11917

Problem:
Data sampling window has discontinuity

Solution:
Move the data as a whole to find a continuous data window

Verify:
txlx

Change-Id: I76fd41c22ff4c9e2e40b2b47580e25e0284ffbfa
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:23 +09:00
ruixuan.li
7d87c9ffe3 sm1: emmc run hs200 busmode [1/1]
PD#SWPL-5404

Problem:
emmc report data crc error in hs200 busmode

Solution:
set hs200 co_phase to 2 and did not reset the
hs200 co_phase and tx_phase when adjust tuning is
find the error point in sm1

Verify:
verify pass on sm1_s905d3_ac200

Change-Id: I56aa8eb666fb55641db75878a3488f66c721bd6d
Signed-off-by: ruixuan.li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_skt.dts
	drivers/amlogic/mmc/aml_sd_emmc.c
2020-06-29 11:45:23 +09:00
Ruixuan Li
766e9299ea emmc: run hs400 166M busmod on sm1 [1/1]
PD#SWPL-10719

Problem:
hs400 200M not stable on sm1

Solution:
run hs400 166M busmod

Verify:
passed on sm1_ac200

Change-Id: I5e5f4db821e8360fdd3ccd6ce24df83446073cf2
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200.dts
2020-06-29 11:45:23 +09:00
Ruixuan Li
1704b15c7d emmc: rescan cmd delay windows to set cmd delay [1/1]
PD#SWPL-10095

Problem:
command delay may too close to the command edge

Solution:
rescan cmd delay windows and find cmd delay value
after data alignment

Verify:
passed on g12b

Change-Id: I258e93aa87e35c843c45f62c58af3609bebe0901
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
2020-06-29 11:45:23 +09:00
Nan Li
9181c96a92 sdio: optimize sdio clk cfg [2/2]
PD#SWPL-9640

Problem:
sdio auto_clk close fail.

Solution:
optimize sdio auto_clk cfg,
add sdio_clk_always_on(int on).

Verify:
G12A_u211

Change-Id: Id760b41a948c6b7e15f675376084b0cdd4edc151
Signed-off-by: Nan Li <nan.li@amlogic.com>
2020-06-29 11:45:22 +09:00
Nan Li
67f1fce48a sdio: optimize sdio clk cfg [1/1]
PD#SWPL-9640

Problem:
sdio auto_clk close fail.

Solution:
optimize sdio auto_clk cfg,
add sdio_clk_always_on().

Verify:
G12A_u211

Change-Id: Iec6e9460ad650001f079844f183d905789aa76e7
Signed-off-by: Nan Li <nan.li@amlogic.com>
2020-06-29 11:45:22 +09:00
Ruixuan Li
7c7d0d6e08 emmc: change emmc busmode from hs400 to hs200 [1/1]
PD#SWPL-9326

Problem:
hs400 200M not stable on some platform

Solution:
modify dts to hs200 mode

Verify:
passed on g12b_revb tl1 sm1 tm2

Change-Id: I45670c979b62a2caeed1e7ebc35b035bbbf8968c
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac200_buildroot.dts
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac202.dts
	arch/arm/boot/dts/amlogic/sm1_s905d3_ac202_1g.dts
	arch/arm/boot/dts/amlogic/sm1_s905x3_ac213.dts
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac200_buildroot.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac202.dts
	arch/arm64/boot/dts/amlogic/sm1_s905d3_ac202_1g.dts
	arch/arm64/boot/dts/amlogic/sm1_s905x3_ac213.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts
2020-06-29 11:45:22 +09:00
ruixuan.li
2dfb3f09d3 tm2: emmc run hs200 busmode [1/1]
PD#SWPL-5658

Problem:
emmc run high speed now

Solution:
modify dts

Verify:
passed on t962e2_ab319

Change-Id: Iedef30bed9547e7f57c883077462f1762c55fda3
Signed-off-by: ruixuan.li <ruixuan.li@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
2020-06-29 11:45:22 +09:00
Long Yu
97964df0de emmc: After standby sleep, clear the CMD tuning flag [1/1]
PD#SWPL-9075

Problem:
Because the CMD tune flag was not cleared before standby,
debug printing was performed during auto tune

Solution:
After standby sleep, clear the CMD tuning flag

Verify:
passed on TL1

Change-Id: Ie4a531346f50983009477131408d81c76d5c020f
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
Long Yu
60f5d0668e emmc: report response crc error on G12B when hs400 200M busmode [1/1]
PD#SWPL-8670

Problem:
G12B report response crc error when hs400 200M busmode

Solution:
find a eyetest hole between 14-20 or 48-54, otherwise
tuning tx_delay and find again and
adjust CMD rx timing dynamically in HS400 mode

Verify:
passed on G12B

Change-Id: I23e4d5118e0ca0564367a77102aea9e1085633a9
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
Ruixuan Li
b29ea67a5d emmc: report response crc error on tl1 when hs400 200M busmode [1/1]
PD#SWPL-7740

Problem:
tl1 report response crc error on tl1 when hs400 200M busmode

Solution:
find a eyetest hole between 14-20 or 48-54, otherwise
tuning tx_delay and find again

Verify:
passed on tl1_skt

Change-Id: I46e2c3c4d7ef24bcac7b44fee73112894540fc33
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
2020-06-29 11:45:22 +09:00
Long Yu
5be14ba9ab emmc: Clear the value of txdelay in legacy mode on the resume process [1/1]
PD#SWPL-7181

Problem:
switch to high-speed from hs200 failed for resume process.

Solution:
set tx_delay as 0 for legacy mode.
clear cfg_cmd_setup

Verify:
verify by TL1

Change-Id: I5dbb1bbc391da864464bf137837a2b0f54ccda42
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
long yu
b5217bc0ee emmc: backward compatible with all HS400 clock sources [1/1]
PD#SWPL-6294

Problem:
TL1 and G12B uses clkin3,TXLX uses clkin2

Solution:
unifying the HS400 source clock name in DTS

Verify:
TL1-T962X2_X301 G12B-Reva G12B-Revb

Change-Id: I7acaf7b4392d757955f43a0b17ac1fad84f53d26
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
long yu
de8540862b storage: emmc: reduce cmd/ds/data pins driver strength for TL1 SOC [1/1]
PD#SWPL-5334

Problem:
TX window is not stable

Solution:
Reduce the drive capability of emmc controller pins

Verify:
TL1-T962X2_X301

Change-Id: Ib641c66131c2dee41eb68fb262f4770f431676b9
Signed-off-by: long yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
long yu
35a4be18ba storage: emmc: Add HS400 busmode support for G12B-RevB [1/1]
PD#SWPL-5040

Problem:
not support HS400 busmode

Solution:
add HS400 busmode support for G12B-RevB

Verify:
T962X-R311,TL1-T962X2_X301,G12B-W400

Change-Id: I11a1f47b9473fa341c7d754a51d6e270551758a7
Signed-off-by: long yu <long.yu@amlogic.com>
2020-06-29 11:45:22 +09:00
Nan Li
0f16306557 sdio: set sdio hs mode co_phase [1/1]
PD#SWPL-5206

Problem:
Setup time in sdio highspeed mode of txlx is
inconsistent with the protocol standard.

Solution:
set co_phase = 2.

Verify:
r321

Change-Id: I3e5a1bca335faea6397513de772d3ee35ea76d40
Signed-off-by: Nan Li <nan.li@amlogic.com>
2020-06-29 11:45:21 +09:00
Nan Li
35bc41f8d8 sd: add sduart not supported flag [1/1]
PD#SWPL-4858

Problem:
tl1 not support sduart

Solution:
add not supported flag in match_data

Verify:
verify by tl1 skt

Change-Id: I651765433bb62892fad770c85a5eccd4805e7c79
Signed-off-by: Nan Li <nan.li@amlogic.com>
2020-06-29 11:45:21 +09:00
Long Yu
e6bbfaf869 storage: emmc: Add HS400 busmode support for TL1 [1/1]
PD#SWPL-2311

Problem:
not support HS400 busmode

Solution:
add HS400 busmode support for TL1

Verify:
TL1-T962X2_X301

Change-Id: I95ac19e9c0c5b84c9225602cda6964aaaee4151e
Signed-off-by: Long Yu <long.yu@amlogic.com>
2020-06-29 11:45:21 +09:00
long yu
1d2e33a395 storage: emmc: Set core_phase to 2 for HS200 mode [1/1]
PD#TV-2112

Problem:
eMMC timing test failed on item tISU

Solution:
set core_phase to 2 for HS200 busmode

Verify:
TL1-T962X2_X301

Change-Id: I1025b6b6b66b2591b7a8faca68ff1852eeb9b85c
Signed-off-by: long yu <long.yu@amlogic.com>
2020-06-29 11:45:21 +09:00
Ruixuan Li
2406d5a0e6 emmc: modify cophase for tl1 [1/1]
PD#172587

Problem:
emmc data crc error

Solution:
modify cophase under kernel for tl1

Verify:
test pass on skt

Change-Id: Id4997ef2288a53e6f401744664aaf6b05cf36e38
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
2020-06-29 11:45:21 +09:00
Hong Guo
2f44178eef cpufreq: defect clean up overrun [1/1]
PD#SWPL-16541

Problem:
defect clean up overrun

Solution:
defect clean up overrun

Verify:
test pass on g12a_u200

Change-Id: Ib9b5c1f5da9fed34a552eb7ee539e7276d922e38
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
2020-06-29 11:45:21 +09:00
Hong Guo
479df3b358 cpufreq: add different freqs variable for big&little core [1/1]
PD#SWPL-15315

Problem:
add different freqs variable for big&little core

Solution:
add different freqs variable for big&little core

Verify:
test pass on g12b_w400

Change-Id: I3fbe4c6ee4f2a0868c84b362acddf16ac41a3dbd
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
2020-06-29 11:45:21 +09:00
Hong Guo
98521f67a4 cpufreq: add different freqs variable for big&little core [1/1]
PD#SWPL-15315

Problem:
add different freqs variable for big&little core

Solution:
add different freqs variable for big&little core

Verify:
test pass on g12b_w400

Change-Id: I2a5e00b5bbd4a1d084b925733a051497c6e92b0b
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
2020-06-29 11:45:21 +09:00
Lei Qian
fed4a57891 cpufreq: merge from mainline
PD#SWPL-15312

Change-Id: I1b354d551721e80f6b3052e9ed4c66437c0b5242
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
2020-06-29 11:45:21 +09:00
Hong Guo
85672bbe4d CPUFREQ: Setting different cpufreq tables according to efuse information. [1/1]
PD#SWPL-4035

Problem:
Setting different cpufreq tables according to efuse information.

Solution:
Setting different cpufreq tables according to efuse information.

Verify:
g12a_u200, verify pass

Change-Id: I1bf571f332244f5727ef3cd8743f215f71248146
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
2020-06-29 11:45:21 +09:00
Hanjie Lin
f5f239177e sched: add hmp boost for big-little cluster [1/1]
PD#SWPL-6980

Problem:
memory bound tasks running in a high freq cluster will get a low performance
when another cluster freq is too low.

Solution:
We boost big cluster freq for a appropriate duration when we detect that
little cluster have lasting a period with highest freq.

Verify:
w400

Change-Id: Ic513604cb329992782c9c2e1d71273080e2e336a
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:21 +09:00
Sunny Luo
3d98c25680 spi nor: spicc: change to use spicc to access spi nor [1/1]
PD#TV-8401

Problem:
Customer needs to access spi nor by the spicc.

Solution:
add spi nor interfaces in spicc driver.
add gd25q80c/FM25Q08A surpport

Verify:
tl1 x301

Change-Id: If94858d46c31fea6b37034a8b1dfe94a9e9f4603
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
2020-06-29 11:45:21 +09:00
Sunny Luo
61beb18a8f spi: export the spi_register_board_info for ko [1/1]
PD#SWPL-9815

Problem:
spi_register_board_info's export has been removed in kernel 4.9,
but TV need to use it in ko.

Solution:
package it in a new dirspi_register_board_info and export

Verify:
T312

Change-Id: Ic7e5d8cef6840551e2925eda6162156320877833
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
2020-06-29 11:45:20 +09:00
Daogao Xu
e69752f803 i2c: add retry-process when slave NACK. [1/1]
PD#SWPL-4761

Problem:
When slave device is busy processing, it is unable to handle the
incoming communication attempts. i2c master have to repeatedly attemp
communication  until the slave sends an ACK after receiving its slave
address.

Solution:
add retry-process when slave NACK.

Verify:
mesonaxg_s420_32_release

Change-Id: Ieb195176cac4b80e223ea6adb502ffd3bc9ef728
Signed-off-by: Daogao Xu <daogao.xu@amlogic.com>
2020-06-29 11:45:20 +09:00
Jian Hu
5222bf6f1a i2c: meson: add detail calculation process for i2c duty cycle [1/1]
PD#SWPL-7197

Problem:
There is not detail calculation process for i2c duty cycle

Solution:
add detail calculation process for i2c duty cycle

Verify:
verified on x301

Change-Id: Ifc222acda3268f792f63e84c6dc3513d80568e19
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2020-06-29 11:45:20 +09:00
Xingyu Chen
645e63770f remote: fix compatibility issue for RC5 protocol [1/1]
PD#SWPL-6161

Problem:
partial ir-keys with RC5 can’t been decoded on some boards(Eg: TL1, TXLX)

Solution:
adjust the register to extend the detection range of half/whole bit

Verify:
test pass on TL1

Change-Id: I6ff0af79b3bf9f624c1f249f056b729df7b5dd0c
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
f08cce9ca9 ir: cannot wakeup system when keep pressing power key [1/1]
PD#SWPL-14797

Problem:
In freeze mode, keep press power key won't wake up system.

Solution:
replace pm_wakup_event with pm_stay_awake

Verify:
tl1

Change-Id: I5b88714ff45034280ec1d638f86b51fa54e2a011
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qiufang Dai
41ee9383b5 freeze: add IRQF_NO_SUSPEND for ir irq flag for avoid wakeup by any IR key
PD#TV-10438

Problem:
system can be wake up by any IR key

Solution:
Add IRQF_NO_SUSPEND to avoid IR interrupt being seen as wakeup source IRQ
When IR irq check current key is power key, then send pm_wakeup_event()

Verify:
X32A0-T972

Change-Id: I753fe15f859480954bb569f2da3d3e0dd93c29e3
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
6805ee9472 ir: fix coverity unchecked return value issue [1/1]
PD#SWPL-13969

Problem:
In sysfs.c, return value of class_register is not checked.

Solution:
check return value of class_register

Verify:
local coverity check

Change-Id: If8deb3e388e784650e4812257143c3ac919c2d9a
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
1c88be3eb3 ir: remove irq affinity in hard decode mode [1/1]
PD#SWPL-9797

Problem:
ir irq is binded to cup 1 and will re-set in every resume process.
cup 0 wakeup first in resume, if there comes a irq during resume in
a critical time it may occurs concurrency.

Solution:
remove irq affinity in hard decode mode and only use it in learning
mode.

Verify:
w400

Change-Id: I26fad9f67665a2bfe9c6d2455559eb1d95e8b2ba
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
d52040136f ir: add ir learning function [1/1]
PD#SWPL-4130

Problem:
No ir learning function in current source code

Solution:
Provide two ways to use ir learning function
1. sysfs
	/*start learning*/
	echo 1 > /sys/class/remote/amremote/ir_learnning
	/*get data*/
	cat /sys/class/remote/amremote/learned_pulse
	/*stop learning*/
	echo 0 > /sys/class/remote/amremote/ir_learnning
2. ioctl
	/*start/stop learnning 1/0*/
	REMOTE_IOC_SET_IR_LEARING
	/*get raw data*/
	REMOTE_IOC_GET_RAW_DATA

Verify:
U200 and W400

Change-Id: Ibb03838402d9baa6e910b3162ffcc63b57048890
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
f7f3031015 ir: fix mem leak issue when probe [1/1]
PD#SWPL-12483

Problem:
during probe stage, some unused mems are not be freed.

Solution:
free mem after using.

Verify:
gxl_p212

Change-Id: I24a91d81f0db9fb1edbab8f63b4e8c7f940d5947
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
a86eb23fed ir: fix allocation of memory without size check issue [1/1]
PD#SWPL-11248

Problem:
When handling the set attribute IOCTL REMOTE_IOC_SET_KEY_NUMBER, the driver
does not limit the size of allocation with kzalloc.

Solution:
Limit the size of alllcation range, if given a value out of range, set
update flag to false and do nothing in kzalloc stage.

Verify:
W400

Change-Id: I6a4150f5615557c372738c918aad86120d149340
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:20 +09:00
Qianggui Song
efa523b92b ir: support rca ir protocol [1/1]
PD#SWPL-8050

Problem:
current driver does not support rca ir protocol

Solution:
add register setting and code for rca use REMOTE_RYPE_RCA to configure.

Verify:
G12b_W400 & tl1 x301

Change-Id: I76d860d66a43071803fb60debeafcbf18f42b283
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:19 +09:00
Qianggui Song
3dd602667c ir: add toshiba protocol support [1/1]
PD#SWPL-3543

Problem:
current driver does not support toshiba ir remote control protocol

Solution:
add register setting and decode code for toshiba protocol
use REMOTE_TYPE_TOSHIBA/REMOTE_TYPE_NEC_TOSHIBA to configure toshiba
only/toshiba and nec.

Verify:
tl1_t962x2_x301

Change-Id: Idad70c3879fad6e8267f0c4d80d2447c34114103
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2020-06-29 11:45:19 +09:00
Lei Qian
d32bf0570d jtag: tm2: add SWD interface
Change-Id: I4a31de854be2e6d3985a8fec5c11bfbc54803ec5
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
2020-06-29 11:45:19 +09:00
Zhongfu Luo
fdb67c7098 efuse: fix KASAN bug [1/1]
PD#TV-11119

Problem:
BUG: KASAN: stack-out-of-bounds in
meson64_trustzone_efuse+0x168/0x268

Solution:
fix retcnt variable type

Verify:
tl1 skt

Change-Id: I54d9bb598277db539b68f2e741288348eb026e01
Signed-off-by: Zhongfu Luo <zhongfu.luo@amlogic.com>
2020-06-29 11:45:19 +09:00
Jiamin Ma
d58f336aaf efuse: fix potential memory info leakage issue [1/1]
PD#OTT-4656

Problem:
When handling the set attribute IOCTL EFUSE_INFO_GET the driver
makes a call to efuse_getinfo(line 177) passing it a potentially
non-null terminated string. efuse_getinfo() function then uses
this potentially non-null terminated string in strcmp (line 99).
the method efuse_getinfo does not cater to non-null terminated
strings and thus can likely be made to overrun the "item" string
beyond any printable ascii data.
Further more, if attackers can control the item value well enough,
the function efuse_getinfo can be used to potentially disclose
values in kernel memory i.e. by checking the results of lots of
strcmp calls on items values, essentially acting as an oracle for
memory values surrounding the efusekey_info[n].keyname variable in
stack memory.

Solution:
force a null terminator for the keyname argument before comparing
it to kernel memory

Verify:
U200

Change-Id: I851dd7045d0a9e7855e9899c4745eac475cb9233
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:19 +09:00
Jiamin Ma
f49dbe73e2 cpu_affinity: restore the original cpu affinity correctly [1/1]
PD#SWPL-5595

Problem:
set_cpus_allowed_ptr(current, cpu_all_mask) is always errorly
called to retore CPU affinity for current task. In some cases,
the current may be a bounded kworker thread, and we should not
set its CPU affinity to all CPUs

Solution:
Save the original CPU affinity and restore it

Verify:
W400 revB

Change-Id: I3cd65e79791563af9dacc09639b8645b97979c44
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:19 +09:00