Skip to content

Commit

Permalink
txl: lcd: add pinmux control for pinctrl version 2 [1/1]
Browse files Browse the repository at this point in the history
PD#168480

Problem:
kernel4.9 pinctrl config can't be read in uboot

Solution:
add pinmux control in lcd.c for new pinctrl

Verify:
txl r321

Change-Id: I291155ff56f03c57c93dae787ba0fa5d65f76ef1
Signed-off-by: Evoke Zhang <[email protected]>
  • Loading branch information
Evoke Zhang authored and Xiaobo Gu committed Jul 4, 2018
1 parent e858f6b commit c3aa228
Show file tree
Hide file tree
Showing 8 changed files with 362 additions and 5 deletions.
51 changes: 51 additions & 0 deletions board/amlogic/txl_p320_v1/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,52 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
{.panel_type = "invalid"},
};

static struct lcd_pinmux_ctrl_s lcd_pinmux_ctrl[LCD_PINMX_MAX] = {
{
.name = "lcd_vbyone_pin", //GPIOH_0/1
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};
static struct lcd_pinmux_ctrl_s bl_pinmux_ctrl[BL_PINMUX_MAX] = {
{
.name = "bl_pwm_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00004000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00002000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_vs_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00002000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00004000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};

//**** Special parameters just for Vbyone ***//
static struct vbyone_config_s lcd_vbyone_config = {
.lane_count = 8,
Expand Down Expand Up @@ -253,6 +299,9 @@ struct lcd_config_s lcd_config_dft = {
.vbyone_config = &lcd_vbyone_config,
},
.lcd_power = &lcd_power_ctrl,

.pinctrl_ver = 2,
.lcd_pinmux = lcd_pinmux_ctrl,
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
};
Expand Down Expand Up @@ -333,6 +382,8 @@ struct bl_config_s bl_config_dft = {
.pwm_on_delay = 10,
.pwm_off_delay = 10,

.pinctrl_ver = 2,
.bl_pinmux = bl_pinmux_ctrl,
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
};
Expand Down
51 changes: 51 additions & 0 deletions board/amlogic/txl_p321_v1/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,52 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
{.panel_type = "invalid"},
};

static struct lcd_pinmux_ctrl_s lcd_pinmux_ctrl[LCD_PINMX_MAX] = {
{
.name = "lcd_vbyone_pin", //GPIOH_0/1
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};
static struct lcd_pinmux_ctrl_s bl_pinmux_ctrl[BL_PINMUX_MAX] = {
{
.name = "bl_pwm_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00004000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00002000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_vs_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00002000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00004000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};

//**** Special parameters just for Vbyone ***//
static struct vbyone_config_s lcd_vbyone_config = {
.lane_count = 8,
Expand Down Expand Up @@ -253,6 +299,9 @@ struct lcd_config_s lcd_config_dft = {
.vbyone_config = &lcd_vbyone_config,
},
.lcd_power = &lcd_power_ctrl,

.pinctrl_ver = 2,
.lcd_pinmux = lcd_pinmux_ctrl,
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
};
Expand Down Expand Up @@ -333,6 +382,8 @@ struct bl_config_s bl_config_dft = {
.pwm_on_delay = 10,
.pwm_off_delay = 10,

.pinctrl_ver = 2,
.bl_pinmux = bl_pinmux_ctrl,
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
};
Expand Down
51 changes: 51 additions & 0 deletions board/amlogic/txl_p341_v1/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,52 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
{.panel_type = "invalid"},
};

static struct lcd_pinmux_ctrl_s lcd_pinmux_ctrl[LCD_PINMX_MAX] = {
{
.name = "lcd_vbyone_pin", //GPIOH_0/1
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};
static struct lcd_pinmux_ctrl_s bl_pinmux_ctrl[BL_PINMUX_MAX] = {
{
.name = "bl_pwm_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00004000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00002000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_vs_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00002000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00004000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};

//**** Special parameters just for Vbyone ***//
static struct vbyone_config_s lcd_vbyone_config = {
.lane_count = 8,
Expand Down Expand Up @@ -253,6 +299,9 @@ struct lcd_config_s lcd_config_dft = {
.vbyone_config = &lcd_vbyone_config,
},
.lcd_power = &lcd_power_ctrl,

.pinctrl_ver = 2,
.lcd_pinmux = lcd_pinmux_ctrl,
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
};
Expand Down Expand Up @@ -333,6 +382,8 @@ struct bl_config_s bl_config_dft = {
.pwm_on_delay = 10,
.pwm_off_delay = 10,

.pinctrl_ver = 2,
.bl_pinmux = bl_pinmux_ctrl,
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
};
Expand Down
51 changes: 51 additions & 0 deletions board/amlogic/txl_p341_v2/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,52 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
{.panel_type = "invalid"},
};

static struct lcd_pinmux_ctrl_s lcd_pinmux_ctrl[LCD_PINMX_MAX] = {
{
.name = "lcd_vbyone_pin", //GPIOH_0/1
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};
static struct lcd_pinmux_ctrl_s bl_pinmux_ctrl[BL_PINMUX_MAX] = {
{
.name = "bl_pwm_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00004000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00002000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_vs_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00002000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00004000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};

//**** Special parameters just for Vbyone ***//
static struct vbyone_config_s lcd_vbyone_config = {
.lane_count = 8,
Expand Down Expand Up @@ -253,6 +299,9 @@ struct lcd_config_s lcd_config_dft = {
.vbyone_config = &lcd_vbyone_config,
},
.lcd_power = &lcd_power_ctrl,

.pinctrl_ver = 2,
.lcd_pinmux = lcd_pinmux_ctrl,
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
};
Expand Down Expand Up @@ -333,6 +382,8 @@ struct bl_config_s bl_config_dft = {
.pwm_on_delay = 10,
.pwm_off_delay = 10,

.pinctrl_ver = 2,
.bl_pinmux = bl_pinmux_ctrl,
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
};
Expand Down
51 changes: 51 additions & 0 deletions board/amlogic/txl_p346_v1/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,52 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
{.panel_type = "invalid"},
};

static struct lcd_pinmux_ctrl_s lcd_pinmux_ctrl[LCD_PINMX_MAX] = {
{
.name = "lcd_vbyone_pin", //GPIOH_0/1
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};
static struct lcd_pinmux_ctrl_s bl_pinmux_ctrl[BL_PINMUX_MAX] = {
{
.name = "bl_pwm_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00004000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00002000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_0_vs_on_pin", //GPIOZ_6
.pinmux_set = {{4, 0x00008000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00010000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "bl_pwm_combo_1_vs_on_pin", //GPIOZ_7
.pinmux_set = {{4, 0x00002000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00004000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
},
{
.name = "invalid",
},
};

//**** Special parameters just for Vbyone ***//
static struct vbyone_config_s lcd_vbyone_config = {
.lane_count = 8,
Expand Down Expand Up @@ -253,6 +299,9 @@ struct lcd_config_s lcd_config_dft = {
.vbyone_config = &lcd_vbyone_config,
},
.lcd_power = &lcd_power_ctrl,

.pinctrl_ver = 2,
.lcd_pinmux = lcd_pinmux_ctrl,
.pinmux_set = {{0, 0xc0000000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{LCD_PINMUX_END, 0x0}},
};
Expand Down Expand Up @@ -333,6 +382,8 @@ struct bl_config_s bl_config_dft = {
.pwm_on_delay = 10,
.pwm_off_delay = 10,

.pinctrl_ver = 2,
.bl_pinmux = bl_pinmux_ctrl,
.pinmux_set = {{4, 0x00010000}, {LCD_PINMUX_END, 0x0}},
.pinmux_clr = {{4, 0x00008000}, {3, 0x00200000}, {LCD_PINMUX_END, 0x0}},
};
Expand Down
Loading

0 comments on commit c3aa228

Please sign in to comment.