Latest Post
Mango-IMX6Q Android 9.0 포팅가이드-03( kernel 드라이버 포팅)

4. 커널 디바이스 드라이버 포팅

4.1. 커널에서 불필요한 디바이스 삭제

4.1.1. Mango-IMX6Q에 없는 디바이스 config 없애기

4.1.2. PMIC 없으므로 LDO로 변경하기

4.2. Display , 터치 드라이브 포팅

4.2.1. LCD Power EN, Backlight GPIO 포팅

4.2.2. 7인치 감압식 LCD 드라이버 포팅

4.2.3. 10.1인치 정전식 LCD 드라이버 포팅

4.2.4. 정전식 드라이버 포팅하기

4.2.5. 7인치 정전식 LCD 드라이버 포팅

1. 커널 디바이스 드라이버 포팅

1.1. 커널에서 불필요한 디바이스 삭제

커널에서 Mango-IMX6Q에서 사용하지 않는 Device부터 삭제하고, 디바이별로 포팅하는 것이 좋다.

1.1.1. Mango-IMX6Q에 없는 디바이스 config 없애기

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일을 수정하면 된다.

Device tree는 공부를 해야 한다.

#if 0 //crazyboys 20200907

hannstar_cabc {

compatible = "hannstar,cabc";

lvds0 {

gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;

};

lvds1 {

gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>;

};

};

#endif

#if 0 //crazyboys 20200907

codec: wm8962@1a {

compatible = "wlf,wm8962";

reg = <0x1a>;

clocks = <&clks IMX6QDL_CLK_CKO>;

DCVDD-supply = <&reg_audio>;

DBVDD-supply = <&reg_audio>;

AVDD-supply = <&reg_audio>;

CPVDD-supply = <&reg_audio>;

MICVDD-supply = <&reg_audio>;

PLLVDD-supply = <&reg_audio>;

SPKVDD1-supply = <&reg_audio>;

SPKVDD2-supply = <&reg_audio>;

gpio-cfg = <

0x0000 /* 0:Default */

0x0000 /* 1:Default */

0x0013 /* 2:FN_DMICCLK */

0x0000 /* 3:Default */

0x8014 /* 4:FN_DMICCDAT */

0x0000 /* 5:Default */

>;

amic-mono;

};

mma8451@1c {

compatible = "fsl,mma8451";

reg = <0x1c>;

position = <0>;

vdd-supply = <&reg_sensor>;

vddio-supply = <&reg_sensor>;

interrupt-parent = <&gpio1>;

interrupts = <18 8>;

interrupt-route = <1>;

};

ov564x: ov564x@3c {

compatible = "ovti,ov564x";

reg = <0x3c>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_ipu1_2>;

clocks = <&clks IMX6QDL_CLK_CKO>;

clock-names = "csi_mclk";

DOVDD-supply = <&vgen4_reg>; /* 1.8v */

AVDD-supply = <&vgen3_reg>; /* 2.8v, on rev C board is VGEN3,

on rev B board is VGEN5 */

DVDD-supply = <&vgen2_reg>; /* 1.5v*/

pwn-gpios = <&gpio1 16 1>; /* active low: SD1_DAT0 */

rst-gpios = <&gpio1 17 0>; /* active high: SD1_DAT1 */

csi_id = <0>;

mclk = <24000000>;

mclk_source = <0>;

};

#endif

#if 0 //crazyboys 0907

egalax_ts@04 {

compatible = "eeti,egalax_ts";

reg = <0x04>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_i2c2_egalax_int>;

interrupt-parent = <&gpio6>;

interrupts = <8 2>;

wakeup-gpios = <&gpio6 8 0>;

};

max11801@48 {

compatible = "maxim,max11801";

reg = <0x48>;

interrupt-parent = <&gpio3>;

interrupts = <26 2>;

work-mode = <1>;/*DCM mode*/

};

pmic: pfuze100@08 {

compatible = "fsl,pfuze100";

reg = <0x08>;

#endif

#if 0

ov564x_mipi: ov564x_mipi@3c { /* i2c2 driver */

compatible = "ovti,ov564x_mipi";

reg = <0x3c>;

clocks = <&clks 201>;

clock-names = "csi_mclk";

DOVDD-supply = <&vgen4_reg>; /* 1.8v */

AVDD-supply = <&vgen3_reg>; /* 2.8v, rev C board is VGEN3

rev B board is VGEN5 */

DVDD-supply = <&vgen2_reg>; /* 1.5v*/

pwn-gpios = <&gpio1 19 1>; /* active low: SD1_CLK */

rst-gpios = <&gpio1 20 0>; /* active high: SD1_DAT2 */

csi_id = <1>;

mclk = <24000000>;

mclk_source = <0>;

};

#endif

1.1.2. PMIC 없으므로 LDO로 변경하기

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일 수정

&reg_arm {

/delete-property/ vin-supply;

};

&reg_pu {

/delete-property/ vin-supply;

};

&reg_soc {

/delete-property/ vin-supply;

};

1.2. Display , 터치 드라이브 포팅

1.2.1. LCD Power EN, Backlight GPIO 포팅

LCD 화면을 디스플레이하기 위해서는 아래 회로도에 GPIO 핀을 컨트롤해야 한다.

구분

Pad Name

GPIO

LCD_BL_CTRL

SD1_DAT2

GPIO1_19

DISP0_PWR_EN

ENET_TXD0

GPIO1_30

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일에서 아래와 같이 수정을 한다.

mxcfb1: fb@0 {

compatible = "fsl,mxc_sdc_fb";

disp_dev = "lcd";

interface_pix_fmt = "BGR24";

//interface_pix_fmt = "RGB24";

mode_str ="MANGO-CAP7";

default_bpp = <24>;

int_clk = <0>;

late_init = <0>;

status = "disabled";

};

lcd@0 {

compatible = "fsl,lcd";

ipu_id = <0>;

disp_id = <0>;

default_ifmt = "BGR24";

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_ipu1>;

power_en_gpio = <&gpio1 30 0>; /* Power EN */

backlight_ctl_gpio = <&gpio1 19 0>; /* Backlight CTRL */

status = "okay";

Default_ifmt가 BGR24인 것은 LCD와 연결하는 핀맵이 B->G->R로 연결되어 있다.

“power_en_gpio”와 “backlight_ctl_gpio”는

drivers/video/fbdev/mxc/mxc_lcdif.c 파일에 추가를 한다.

//crazyboys 20200908

#include <linux/gpio.h>

#include <linux/of_gpio.h>

static int mxc_lcdif_probe(struct platform_device *pdev)

{

int ret;

struct pinctrl *pinctrl;

struct mxc_lcdif_data *lcdif;

struct mxc_lcd_platform_data *plat_data;

//crazyboys 20200908

struct device_node *np = pdev->dev.of_node;

enum of_gpio_flags flags;

unsigned int pwr_gpio,backlight_gpio;

int status=-1;

//end

//crazyboys 20200908

#if 1

pwr_gpio = of_get_named_gpio_flags(np, "power_en_gpio", 0, &flags);

if(pwr_gpio == -EPROBE_DEFER){

dev_err(&pdev->dev, "LCD Power Enalbe Gpio fail\n");

return pwr_gpio;

}

status = devm_gpio_request_one(&pdev->dev,pwr_gpio,GPIOF_OUT_INIT_HIGH,NULL);

if(status < 0 )

{

dev_err(&pdev->dev, "failed to request gpio %d: %d\n",pwr_gpio,status);

return status;

}

backlight_gpio = of_get_named_gpio_flags(np, "backlight_ctl_gpio", 0, &flags);

if(backlight_gpio == -EPROBE_DEFER){

dev_err(&pdev->dev, "Backlight Ctrl Gpio fail\n");

return backlight_gpio;

}

status = devm_gpio_request_one(&pdev->dev,backlight_gpio,GPIOF_OUT_INIT_HIGH,NULL);

if(status < 0 )

{

dev_err(&pdev->dev, "Backlight Ctrl GPIO Request Fail status %d\n",status);

return status;

}

#endif

probe하면서 GPIO를 High한다.

PWM으로 Backlight를 조정할 수 있다.

IMX6DQRM-Reference Manual.pdf 파일을 보면 PWM2_OUT으로 사용 할 수 있다.

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일 수정

backlight {

compatible = "pwm-backlight";

//pwms = <&pwm2 0 50000>;

pwms = <&pwm2 0 400000>;//2.5KHz

//pwms = <&pwm2 0 40000>;//25KHz

//pwms = <&pwm2 0 4000>;//250KHz

brightness-levels = <

0 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29

30 31 32 33 34 35 36 37 38 39

40 41 42 43 44 45 46 47 48 49

50 51 52 53 54 55 56 57 58 59

60 61 62 63 64 65 66 67 68 69

70 71 72 73 74 75 76 77 78 79

80 81 82 83 84 85 86 87 88 89

90 91 92 93 94 95 96 97 98 99

100

>;

default-brightness-level = <100>;

status = "okay";

};

pinctrl_pwm2: pwm2grp {

fsl,pins = <

MX6QDL_PAD_SD1_DAT2__PWM2_OUT 0x1b0b1

>;

};

&pwm2 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_pwm2>;

status = "okay";

};

테스트 방법

# echo 10 > /sys/class/backlight/backlight/brightness => 어둡게

# echo 100 > /sys/class/backlight/backlight/brightness => 밝게

1.2.2. 7인치 감압식 LCD 드라이버 포팅

드라이버 포팅을 위해서 7인치 감압식 LCD(AT070TN94) 데이터 시트, Mango-IMX6Q 회로도가 필요하다. LCD 드라이버에 타이밍을 보기 위해서 7인치 감압식 LCD 데이터 시트가 필요하다.

데이터시트를 보면 타이밍이 아래와 같이 나와 있다.

타이밍 표를 보고, 타이밍을 맞추면 된다.

DCLK Frequency를 26.4MHz로 했을 때 타이밍 값이다.

drivers/video/fbdev/mxc/mxc_lcdif.c 파일에 static struct fb_videomode lcdif_modedb[] 배열에 추가하면 된다.

"MANGO-PRESS7", //name

60, //refresh

800, //xres

480, //yres

37879, //pixclock(ns)

46, //left_margin(HBP)

16, //right_margin(HFP)

23, //upper_margin(VBP)

7, //lower_margin(VFP)

1, //hsync_len

1, //vsync_len

FB_SYNC_CLK_LAT_FALL, //sync

FB_VMODE_NONINTERLACED | FB_VMODE_ODD_FLD_FIRST, //vmode

0,}, //flag

터치 드라이버 포팅 감압식 LCD이다.

중간에 tsc2007 칩이 있다.

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일에 추가

touchscreen: tsc2007@4a {

compatible = "ti,tsc2007";

reg = <0x4a>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_mango_ts>;

interrupt-parent = <&gpio3>;

interrupts = <26 0>;

gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;

ti,x-plate-ohms = <660>;

linux,wakeup;

};

커널 드라이버는 drivers/input/touchscreen/tsc2007_core.c 사용하면 된다.

테스트 방법은 아래와 같이 하면 된다. 리눅스 파일 시스템에서 테스트 했다.

# ts_calibrate

xres = 800, yres = 480

Took 7 samples...

Top left : X = 337 Y = 534

Took 7 samples...

Top right : X = 3727 Y = 590

Took 8 samples...

Bot right : X = 3683 Y = 3496

Took 7 samples...

Bot left : X = 314 Y = 3519

Took 5 samples...

Center : X = 2045 Y = 2030

-23.375244 0.207105 0.002348

-21.038757 -0.000633 0.128980

Calibration constants: -1531920 13572 153 -1378796 -41 8452 65536

[CRZ] drivers/input/touchscreen/tsc2007_core.c (193) tsc2007_stop:

# ts_test

1.2.3. 10.1인치 정전식 LCD 드라이버 포팅

10.1인치 타이밍은 아래와 같이 맞춘다.

drivers/video/fbdev/mxc/mxc_lcdif.c 파일 수정

"MANGO-CAP10.1", //name

60, //refresh

1280, //xres

800, //yres

13468, //pixclock(ns)

68, //left_margin(HBP)

60, //right_margin(HFP)

8, //upper_margin(VBP)

8, //lower_margin(VFP)

2, //hsync_len

2, //vsync_len

0, //sync

FB_VMODE_NONINTERLACED, //vmode

0,}, //flag

테스트 결과

# fbset

mode "1280x800-64"

# D: 74.250 MHz, H: 52.660 kHz, V: 64.376 Hz

geometry 1280 800 1280 800 24

timings 13468 68 60 8 8 2 2

accel false

rgba 8/16,8/8,8/0,0/0

endmode

1.2.4. 정전식 드라이버 포팅하기

7인치 정전식 LCD와 10.1인치 정전식 LCD에 사용하는 터치 드라이버이다.

정전식 터치를 사용한다.

CX-IMX6Q 회로도를 보면, I2C 2번 bus를 사용한다.

인터럽터 핀과 터치 리셋 핀이 있다.

구분

핀 이름

GPIO

CT_RST_N

SD1_CMD

GPIO1_IO18

C_TS_INT_N

EIM_D26

GPIO3_IO26

선 핀을 device tree에서 정의를 한다.

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일 수정

pinctrl_mango_ts: mango_ts {

fsl,pins = <

/* Reset*/

MX6QDL_PAD_SD1_CMD__GPIO1_IO18 0x17059

/* Interrupt */

MX6QDL_PAD_EIM_D26__GPIO3_IO26 0x17059

>;

};

U1 부품 6번 PIN이 LOW를 유지한다.

원인은 TSC2007 칩에서 인터럽트가 발생을 하여 LOW로 유지를 한다.

CR-LIF2-CT101R001 LCD보드에서 TSC2007 과 연결되는 C_TOUCH_XP, C_TOUCH_YP, C_TOUCH_XM, C_TOUCH_YM 핀이 Ground로 되어 있어, 터치가 눌린 것으로 인식한다.

정전식 Touch를 사용할 경우 TSC2007 칩에 IRQ Disable을 하여 사용하도록 수정

커널 imx6qdl-sabresd.dtsi 파일 수정한다.

mango-ts@38 {

compatible = "mango,mango-ts";

reg = <0x38>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_mango_ts>;

interrupt-parent = <&gpio3>;

interrupts = <26 0>;

//resets = <&mango_ts_reset>;

reset-gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;

};

tsc2007@4a {

compatible = "ti,tsc2007";

reg = <0x4a>;

//pinctrl-names = "default";

//pinctrl-0 = <&pinctrl_mango_ts>;

//interrupt-parent = <&gpio3>;

//interrupts = <26 0>;

//gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;

// ti,x-plate-ohms = <660>;

// linux,wakeup;

};

터치 드라이버는 http://crztech.iptime.org:8080/Release/mango-imx6q/Android6.0/20171204/mango-imx6qxf-android6.0-10.1inch-sd-wifi-5M-MIPI-src-20171204.tgz 에서 터치 드라이버를 추출한다.

mango_ft5x06_ts.c , mango_ft5x06_ts.h 파일이다.

컴파일 시 에러가 발생을 한다.

drivers/input/touchscreen/mango_ft5x06_ts.c:1419:13: error: 'struct file' has no member named 'f_dentry'

drivers/input/touchscreen/mango_ft5x06_ts.c:2097:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

drivers/input/touchscreen/mango_ft5x06_ts.c:2147:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]

drivers/input/touchscreen/mango_ft5x06_ts.c:2151:20: error: expected declaration specifiers or '...' before string constant

MODULE_DESCRIPTION("FocalTech ft5x0x TouchScreen driver");

^

drivers/input/touchscreen/mango_ft5x06_ts.c:2152:16: error: expected declaration specifiers or '...' before string constant

MODULE_LICENSE("GPL");

<디버깅>

drivers/input/touchscreen/mango_ft5x06_ts.c:1419:13: error: 'struct file' has no member named 'f_dentry'

ð Include/linux/fs.h 파일에 정의가 되어 있지 않다. 아래와 같이 수정한다.

struct file {

union {

struct llist_node fu_llist;

struct rcu_head fu_rcuhead;

} f_u;

struct path f_path;

#define f_dentry f_path.dentry //crazyboys 20200910

drivers/input/touchscreen/mango_ft5x06_ts.c 파일에서 include 파일 수정.

드라이버가 3.x 커널에서 사용하던 거라, 커널 4.14로 되면서 많이 변경이 되었네요.

#include <linux/module.h>

#include <linux/init.h>

#include <linux/i2c.h>

#include <linux/interrupt.h>

#include <linux/input.h>

#include <linux/irq.h>

#include <linux/gpio.h>

#include <linux/delay.h>

#include <linux/slab.h>

#include <linux/bitops.h>

#include <linux/input/mt.h>

#include <linux/of_gpio.h>

#include <linux/reset.h>

#include <linux/fs.h>

drivers/input/touchscreen/Makefile 파일 추가

obj-$(CONFIG_MANGO_TOUCH_FT5x06_101INCH) += mango_ft5x06_ts.o

obj-$(CONFIG_MANGO_TOUCH_FT5x06_7INCH) += mango_ft5x06_ts.o

drivers/input/touchscreen/Kconfig 파일에 아래 내용 추가

config MANGO_TOUCH_FT5x06_7INCH

tristate "crztech mango 7 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 10.1" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

config MANGO_TOUCH_FT5x06_7INCH_90_ROT

tristate "90 Rotation mango 7 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 7" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

config MANGO_TOUCH_FT5x06_7INCH_270_ROT

tristate "270 Rotation mango 7 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 7" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

config MANGO_TOUCH_FT5x06_101INCH

tristate "crztech mango 10.1 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 10.1" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

config MANGO_TOUCH_FT5x06_10INCH_90_ROT

tristate "90 Rotation mango 10.1 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 10.1" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

config MANGO_TOUCH_FT5x06_10INCH_270_ROT

tristate "270 Rotation mango 10.1 inch FT5x06 PCAP touch "

depends on INPUT_TOUCHSCREEN

default n

help

Say Y here to enable the driver for the 10.1" FT5x06 PCAP touchscreen on the Mango board.

If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

커널 Configuration에서 CONFIG_MANGO_TOUCH_FT5x06_101INCH=y 추가한다.

tsc2007.c 파일에서 수정 한다.

drivers/input/touchscreen/Kconfig 파일에 아래 내용 추가

config MANGO_TSC2007_IRQ_DISABLE

tristate "TSC2007 based touchscreens irq disable"

depends on I2C

help

Say Y here if you have a TSC2007 based touchscreen irq disable.

If unsure, say N.

To compile this driver as a module, choose M here: the

module will be called tsc2007.

“tsc2007_core.c” 파일 수정

static void tsc2007_stop(struct tsc2007 *ts)

{

int err;//crazyboys 20160517

//MANGO_DBG("\n");

ts->stopped = true;

mb();

wake_up(&ts->wait);

disable_irq(ts->irq);

#ifdef CONFIG_MANGO_TSC2007_IRQ_DISABLE//crazyboys 20160517

err = tsc2007_xfer(ts, ADC_ON_12BIT);

#endif

static int tsc2007_open(struct input_dev *input_dev)

{

struct tsc2007 *ts = input_get_drvdata(input_dev);

int err;

ts->stopped = false;

mb();

enable_irq(ts->irq);

#ifndef CONFIG_MANGO_TSC2007_IRQ_DISABLE //crazyboys 20200910

/* Prepare for touch readings - power down ADC and enable PENIRQ */

err = tsc2007_xfer(ts, PWRDOWN);

if (err < 0) {

tsc2007_stop(ts);

return err;

}

#endif

return 0;

}

static int tsc2007_probe(struct i2c_client *client,

const struct i2c_device_id *id)

{

const struct tsc2007_platform_data *pdata =

dev_get_platdata(&client->dev);

struct tsc2007 *ts;

struct input_dev *input_dev;

int err;

if (!i2c_check_functionality(client->adapter,

I2C_FUNC_SMBUS_READ_WORD_DATA))

return -EIO;

ts = devm_kzalloc(&client->dev, sizeof(struct tsc2007), GFP_KERNEL);

if (!ts)

return -ENOMEM;

#ifndef CONFIG_MANGO_TSC2007_IRQ_DISABLE //crazyboys 20200910

if (pdata)

err = tsc2007_probe_pdev(client, ts, pdata, id);

else

err = tsc2007_probe_dt(client, ts);

if (err)

return err;

#endif

ifndef CONFIG_MANGO_TSC2007_IRQ_DISABLE

err = devm_request_threaded_irq(&client->dev, ts->irq,

tsc2007_hard_irq, tsc2007_soft_irq,

IRQF_ONESHOT,

client->dev.driver->name, ts);

if (err) {

dev_err(&client->dev, "Failed to request irq %d: %d\n",

ts->irq, err);

return err;

}

#endif

#ifndef CONFIG_MANGO_TSC2007_IRQ_DISABLE

/* power down the chip (TSC2007_SETUP does not ACK on I2C) */

err = tsc2007_xfer(ts, PWRDOWN);

if (err < 0) {

dev_err(&client->dev,

"Failed to setup chip: %d\n", err);

return err; /* chip does not respond */

}

err = input_register_device(input_dev);

if (err) {

dev_err(&client->dev,

"Failed to register input device: %d\n", err);

return err;

}

err = tsc2007_iio_configure(ts);

if (err) {

dev_err(&client->dev,

"Failed to register with IIO: %d\n", err);

return err;

}

#endif

에러 발생

[CRZ] drivers/input/touchscreen/tsc2007_core.c (342) tsc2007_probe:

imx6q-pinctrl 20e0000.iomuxc: pin MX6Q_PAD_SD1_CMD already requested by 20e0000.iomuxc; cannot claim for 1-0038

imx6q-pinctrl 20e0000.iomuxc: pin-210 (1-0038) status -22

imx6q-pinctrl 20e0000.iomuxc: could not request pin 210 (MX6Q_PAD_SD1_CMD) from group mango_ts on device 20e0000.iomuxc

mango-ts 1-0038: Error applying setting, reverse things back

mango-ts: probe of 1-0038 failed with error -22

snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-rtc-lp as rtc0

MX6Q_PAD_SD1_CMD 이중으로 define되어있다는 것이다.

중복으로 선언 된 부분을 삭제하면 된다.

커널 메시지에서 아래와 같이 나오면, 인식이 된 것이다.

[CRZ] drivers/input/touchscreen/mango_ft5x06_ts.c (1792) ft5x06_i2c_ts_probe_dt:

input: mango-ts as /devices/virtual/input/input1

CRZ ft5x0x_ts_probe reset timer start

--------[FTS] Firmware version = 0x61

------[FTS] report rate is 0Hz.

---------[FTS] touch threshold is 500.

테스트 방법과 확인 방법은 아래와 같다.

# cat /proc/bus/input/devices

I: Bus=0018 Vendor=0000 Product=0000 Version=0000

N: Name="mango-ts"

P: Phys=

S: Sysfs=/devices/virtual/input/input1

U: Uniq=

H: Handlers=kbd event0

B: PROP=0

B: EV=b

B: KEY=400 0 4 0 0 0 0 c0000 0 0 0

B: ABS=2650000 1000000

1.2.5. 7인치 정전식 LCD 드라이버 포팅

커널 Configuration 한다.

CONFIG_MANGO_TOUCH_FT5x06_7INCH=y

CONFIG_MANGO_TSC2007_IRQ_DISABLE=y

타이밍은 아래와 같이 세팅을 한다.

"MANGO-CAP7", //name

60, //refresh

1024, //xres

600, //yres

19531, //pixclock(ns)

60, //left_margin(HBP)

60, //right_margin(BFP)

5, //upper_margin(VBP)

5, //lower_margin(VFP)

200, //hsync_len

25, //vsync_len

0, //sync

FB_VMODE_NONINTERLACED, //vmode

0,}, //flag

커널 로그에서 터치가 인식이 되면 아래와 같이 나오면 정상이다.

[CRZ] drivers/input/touchscreen/tsc2007_core.c (342) tsc2007_probe:

[CRZ] drivers/input/touchscreen/tsc2007_core.c (193) tsc2007_stop:

[CRZ] drivers/input/touchscreen/mango_ft5x06_ts.c (1828) ft5x0x_ts_probe: [FTS] ft5x0x_ts_probe, driver version is 3.0.

[CRZ] drivers/input/touchscreen/mango_ft5x06_ts.c (1792) ft5x06_i2c_ts_probe_dt:

[CRZ] drivers/input/touchscreen/mango_ft5x06_ts.c (1865) ft5x0x_ts_probe: tsdata->reset_pin=18

usb 1-1: new high-speed USB device number 2 using ci_hdrc

input: mango-ts as /devices/virtual/input/input1

CRZ ft5x0x_ts_probe reset timer start

usb 1-1: New USB device found, idVendor=05e3, idProduct=0608

usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0

usb 1-1: Product: USB2.0 Hub

hub 1-1:1.0: USB hub found

hub 1-1:1.0: 4 ports detected

--------[FTS] Firmware version = 0x13

------[FTS] report rate is 100Hz.

---------[FTS] touch threshold is 200.

“fbset” 명령으로 확인 시 아래와 같다.

mode "1024x600-60"

# D: 51.201 MHz, H: 38.096 kHz, V: 59.993 Hz

geometry 1024 600 1024 600 32

timings 19531 60 60 5 5 200 25

accel false

rgba 8/16,8/8,8/0,8/24

endmode

# cat /sys/class/graphics/fb0/mode

U:1024x600p-60

1.2.6. PMIC 없으므로 LDO로 변경하기

1.3. USB Host 확인

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 아래와 같이 정의가 되어 있으면 된다.

&usbh1 {

vbus-supply = <&reg_usb_h1_vbus>;

status = "okay";

};

확인 방법

USB Storage를 꽂아서 확인하면 된다.

usb 1-1.2: new high-speed USB device number 3 using ci_hdrc

usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0723

usb 1-1.2: New USB device strings: Mfr=3, Product=4, SerialNumber=2

usb 1-1.2: Product: USB Storage

usb 1-1.2: Manufacturer: Generic

usb 1-1.2: SerialNumber: 000000009451

usb-storage 1-1.2:1.0: USB Mass Storage device detected

usb-storage 1-1.2:1.0: Quirks match for vid 05e3 pid 0723: 8000

scsi host0: usb-storage 1-1.2:1.0

scsi 0:0:0:0: Direct-Access Generic STORAGE DEVICE 9451 PQ: 0 ANSI: 0

sd 0:0:0:0: [sda] 15628288 512-byte logical blocks: (8.00 GB/7.45 GiB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] No Caching mode page found

sd 0:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

1.4. eMMC 모듈 테스트

Mango-IMX6Q에서는 USDHC3이 eMMC로 사용한다.

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일에서 cd-gpios, wp-gpios 핀을 사용하지 않으므로

아래와 같이 수정한다.

&usdhc3 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_usdhc3>;

bus-width = <8>;

//cd-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;

//wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;

keep-power-in-suspend;

enable-sdio-wakeup;

status = "okay";

};

eMM_RESET_N 핀은 SD3_RST 핀에 연결되어 있다.

pinctrl_usdhc3: usdhc3grp {

fsl,pins = <

MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059

MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059

MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059

MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059

MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059

MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059

MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059

MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059

MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059

MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059

MX6QDL_PAD_SD3_RST__SD3_RESET 0x17059 //crazyboys 20200910

>;

};

인식이 되는지 확인 한다.

eMMC 모듈 장착부분은 하드웨어 매뉴얼을 참조한다.

mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA

mmc2: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA

sdhci-esdhc-imx 219c000.usdhc: Got CD GPIO

mmc3: SDHCI controller on 219c000.usdhc [219c000.usdhc] using ADMA

mmc2: new DDR MMC card at address 0001

mxc_vpu 2040000.vpu_fsl: VPU initialized

mxc_hdmi_cec soc:hdmi_cec@00120000: HDMI CEC initialized

mmcblk2: mmc2:0001 8GND3R 7.28 GiB

Galcore version 6.2.4.190076

mmcblk2boot0: mmc2:0001 8GND3R partition 1 4.00 MiB

mmcblk2boot1: mmc2:0001 8GND3R partition 2 4.00 MiB

mmcblk2rpmb: mmc2:0001 8GND3R partition 3 512 KiB

mmcblk2: p1 p2 p3 < p5 p6 p7 p8 p9 > p4

1.5. SDHC4 포팅

SD4_CDN 핀이 있다. GPIO2_IO12 사용한다.

Micro SD 카드 Slot에 Micro SD 카드를 삽입하여 테스트 한다.

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일 수정

pinctrl_usdhc4: usdhc4grp {

fsl,pins = <

MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059

MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059

MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059

MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059

MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059

MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059

MX6QDL_PAD_SD4_DAT4__GPIO2_IO12 0x13069 /* crazyboys 20200910 cd pin */

#if 0 //crazyboys 20200910

MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059

MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059

MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059

MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059

#endif

&usdhc4 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_usdhc4>;

bus-width = <4>;

cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;

no-1-8-v;

keep-power-in-suspend;

status = "okay";

};

1.6. Watchdog 포팅

arch/arm/boot/dts/imx6qdl-sabresd.dtsi 파일 수정

&gpc {

fsl,ldo-bypass = <0>;/* CRZ_icanjji crazyboys 20161201 */

fsl,wdog-reset = <1>; /* crazyboys 20160225 watchdog select of reset source */

pu-supply = <&reg_pu>; /* ldo-bypass:use pu_dummy if VDDSOC share with VDDPU */

};

&wdog1 {

status = "okay";

};

&wdog2 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_wdog>;

fsl,ext-reset-output;

status = "disabled";

};

Watchdog 테스트 방법

cat > /dev/watchdog

Hit return once

Wait 60 seconds

Wachdog reset.

Comments 0
:    :    :
이름 / 2014-11-20 / ★★★☆☆ [수정 / 삭제]

내용

Recent Comments
일방통행  |  ★★★★★
ISE 14.7 virtualbox를 설치했는데, ,iMPACT가 인식을 못하는데, 어케해야하나요?
min  |  ★★★★☆
These are the only Drives available to write images to: # major minor size name 1: 8 0 512805384 sda 2: 8 16 15558144 sdb Enter Device Number or n to exit: 2 Invalid selection! 왜 이런 오류가 나는 걸까요?
dino  |  ★★☆☆☆
NAND Scrub실행 후 에러가 나타납니다/ 조치방법을 알려주세요 에러내용 crz nand_erase_opts erase.addr=0x0, opt->offset=0x0, erase_ieng minfo_erases=0x20000 .....진행후 s3c-nand:ecc uncorrectable error detected---4개발생합니다 빠른 회신부탁드립니다 연락처:010-3752-6251 강희진
bluewind  |  ★★★★★
안녕하세요..구입했는데..회로도 부탁드립니다. percephy@naver.com 입니다.
조형철  |  ★★★★★
상기 Backlight 관련 회로를 구할 수 있을까요?
hwang  |  ★★★★★
구입한지 조금 됬는데 회로도 부탁합니다. rubens7777@paran.com 입니다.