Skip to content

Commit

Permalink
update, for beta board
Browse files Browse the repository at this point in the history
  • Loading branch information
0x754C committed Mar 26, 2024
1 parent a04c837 commit 262ebab
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,24 @@
&cvi_vo {
#ifndef __UBOOT__
/delete-property/ reset-gpio;
/delete-property/ pwm-gpio;
#else
// for uboot
reset-gpio = <&porte 0 1>;
pwm-gpio = <&porte 2 1>;
#endif
/delete-property/ pwm-gpio;
/delete-property/ power-ct-gpio;

};

&mipi_tx {
/delete-property/ pwm-gpio;
#ifndef __UBOOT__
// for linux kernel
reset-gpio = <&porte 0 1>;
pwm-gpio = <&porte 2 1>;
#else
/delete-property/ reset-gpio;
/delete-property/ pwm-gpio;
#endif
/delete-property/ power-ct-gpio;
status = "okay";
Expand Down Expand Up @@ -146,6 +148,13 @@
};
};

lcd0_backlight: pwm-backlight@0 {
compatible = "pwm-backlight";
pwms = <&pwm2 2 50000000>; // 20Khz
brightness-levels = <0 2 4 8 16 32 64 128 255>;
default-brightness-level = <4>;
};

wifisd:wifi-sd@4320000 {
compatible = "cvitek,cv181x-sdio";
bus-width = <4>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_EVDEV=y
# CONFIG_SERIO is not set
# CONFIG_VT is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=5
Expand Down Expand Up @@ -539,6 +537,10 @@ CONFIG_V4L2_FLASH_LED_CLASS=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_VT=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_PWM=m

# these driver may broken codec driver
# CONFIG_FUSE_FS is not set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ int cvi_board_init(void)
mmio_write_32(0x030010EC, 0x3); // GPIOB 0 GPIO_MODE

// for licheervnano beta
mmio_write_32(0x030010ac, 0x4); // PWRGPIO 2 PWM 10
//mmio_write_32(0x030010ac, 0x4); // PWRGPIO 2 PWM 10
mmio_write_32(0x030010ac, 0x0); // PWRGPIO 2 GPIO_MODE

// camera function
mmio_write_32(0x0300116C, 0x5); // RX4N CAM_MCLK0 for alpha
//mmio_write_32(0x0300118C, 0x5); // RX0N CAM_MCLK1 for beta
//mmio_write_32(0x0300116C, 0x5); // RX4N CAM_MCLK0 for alpha
mmio_write_32(0x0300118C, 0x5); // RX0N CAM_MCLK1 for beta

// camera/tp i2c
mmio_write_32(0x03001090, 0x5); // PWR_GPIO6 IIC4_SCL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,27 @@ then
then
cp /boot/ttyGS0_handler.sh /etc/ttyGS0_handler.sh
fi
if [ -e /boot/alpha ]
then
if [ ! -e /mnt/data/sensor_cfg.ini ]
then
cp /mnt/data/sensor_cfg.ini.alpha /mnt/data/sensor_cfg.ini
fi
# MIPI RX 4N PINMUX MCLK0
devmem 0x0300116C 32 0x5
# MIPI RX 0N PINMUX MIPIP RX 0N
devmem 0x0300118C 32 0x3
echo " alpha "
else
if [ ! -e /mnt/data/sensor_cfg.ini ]
then
cp /mnt/data/sensor_cfg.ini.beta /mnt/data/sensor_cfg.ini
fi
# MIPI RX 4N PINMUX MIPI RX 4N
devmem 0x0300116C 32 0x3
# MIPI RX 0N PINMUX MCLK1
devmem 0x0300118C 32 0x5
echo -n " beta "
fi
echo "OK"
fi
34 changes: 34 additions & 0 deletions buildroot/board/cvitek/SG200X/overlay/mnt/data/sensor_cfg.ini.beta
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[source]

;type = SOURCE_USER_FE

dev_num = 1

; section for sensor

[sensor]

; sensor name
name = GCORE_GC4653_MIPI_4M_30FPS_10BIT

bus_id = 4

sns_i2c_addr = 29

mipi_dev = 0

lane_id = 4, 3, 2, -1, -1

pn_swap = 0, 0, 0, 0, 0

mclk_en = 1

mclk = 1

;port = 0

;pin = 2

;pol = 1

;fps = 30
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ struct combo_dev_attr_s gc4653_rx_attr = {
.mipi_attr = {
.raw_data_type = RAW_DATA_10BIT,
// alpha board
.lane_id = {2, 1, 0, -1, -1},
//.lane_id = {2, 1, 0, -1, -1},
// beta board
//.lane_id = {4, 3, 2, -1, -1},
.lane_id = {4, 3, 2, -1, -1},
.pn_swap = {0, 0, 0, 0, 0},
.wdr_mode = CVI_MIPI_WDR_MODE_NONE,
},
Expand Down

0 comments on commit 262ebab

Please sign in to comment.