前几天从闲鱼淘了一块古老的A13主控的智能音箱的板子,全志A13这颗芯片比较老了,但是想到曾经的荔枝派one上边也是用的这一款主控于是就想着买回来研究一下.
下面是板子的图片:
经过几天的查找资料算是把屏幕驱动了,能显示图片了.也可以播放音乐了.
这块板子的配置 板载一块Nand Flash,没有SD卡槽.... 有串口 屏幕是MCU的接口 wifi部分是ap6212带蓝牙功能 系统是TinaLinux 主要就是这些
因为没有sd卡槽所以有些不方便,一开始尝试编译主线linux,但是卡在了uboot的nand驱动那里,spl能运行,但是不能加载uboot,由于资料有限就没有再继续主线linux,而是从网上下载了别人分享的荔枝派one的sdk,由于原来没有接触过这种的SDK所以搭建环境也费了一些时间,虚拟机不要用版本太高的Ubuntu我是用的14.04的版本.
下面是我修改过的SDK的百度云链接:
链接: https://pan.baidu.com/s/14OH_HRm4ixDTR006GvG4zA?pwd=8jhq 提取码: 8jhq 复制这段内容后打开百度网盘手机App,操作更方便哦
我说一下如何适配屏幕,以为这块屏是MCU接口的跟我以前用的RGB和SPI的屏幕不太一样.
最近编辑记录 917346285aa (2024-11-07 13:41:49)
离线
第一步就是提取设备树:全志的设备树提取的方法好像也是有好几种,我是用的dd命令把系统的前几个分区备份出来然后再通过压缩软件把分区解压就可以得到一个script.bin的文件,通过bin2fex再把编译过的设备树还原成能看懂的源文件就可以了.
下面是我提取出来的设备树文件:
[product]
version = "1.1"
machine = "R8-BAYMIN-V1.0"
[platform]
eraseflag = 1
next_work = 2
debug_mode = 23
[zhc_power]
axp20_fpga = "axp20_ldo4"
axp20_led = "axp20_ldo5"
power_fpga = port:PD21<1><0><default><1>
power_dcin = port:PD22<1><0><default><1>
power_adc = port:PF03<1><0><default><0>
power_amp = port:PD02<1><0><default><1>
[fpga_para]
fpga_used = 1
fpga_name = "iCE40_UL_1K"
fpga_crest_b = port:PD23<1><0><default><0>
fpga_spi_cs0 = port:PE00<1><0><default><0>
fpga_cdone_data_IRQ = port:PB02<0><default><default><default>
fpga_soft_reset = port:PD19<1><0><default><0>
fpga_spi_cs1 = port:PB10<1><0><default><1>
fpga_test = port:PF05<1><1><default><default>
[led_para]
led_used = 1
led_red = port:PF00<1><0><default><1>
led_green = port:PF01<1><0><default><1>
led_blue = port:PF02<1><0><default><1>
[gpio_para]
gpio_used = 1
gpio_pcba_test = port:PF04<0><0><default><default>
[target]
boot_clock = 1008
burn_key = 1
[power_sply]
dcdc2_vol = 1400
dcdc3_vol = 1200
ldo2_vol = 3000
ldo3_vol = 3300
ldo4_vol = 3300
pll4_freq = 960
pll6_freq = 720
[card_boot]
logical_start = 40960
sprite_gpio0 =
[pm_para]
standby_mode = 0
[card_boot0_para]
card_ctrl = 0
card_high_speed = 1
card_line = 4
sdc_d1 = port:PF00<2><1><default><default>
sdc_d0 = port:PF01<2><1><default><default>
sdc_clk = port:PF02<2><1><default><default>
sdc_cmd = port:PF03<2><1><default><default>
sdc_d3 = port:PF04<2><1><default><default>
sdc_d2 = port:PF05<2><1><default><default>
[twi_para]
twi_port = 0
twi_scl = port:PB00<2><1><default><default>
twi_sda = port:PB01<2><1><default><default>
[uart_para]
uart_debug_port = 1
uart_debug_tx = port:PG03<4><1><default><default>
uart_debug_rx = port:PG04<4><1><default><default>
[uart_force_debug]
uart_debug_port = 0
uart_debug_tx = port:PG03<4><default><default><default>
uart_debug_rx = port:PG04<4><default><default><default>
[jtag_para]
jtag_enable = 0
jtag_ms = port:PF00<4><1><default><default>
jtag_ck = port:PF05<4><1><default><default>
jtag_do = port:PF03<4><1><default><default>
jtag_di = port:PF01<4><1><default><default>
[dram_para]
dram_baseaddr = 0x40000000
dram_clk = 456
dram_type = 3
dram_rank_num = 1
dram_chip_density = 4096
dram_io_width = 16
dram_bus_width = 16
dram_cas = 9
dram_zq = 0x7a
dram_odt_en = 0
dram_size = 512
dram_tpr0 = 0x42d899b7
dram_tpr1 = 0xa090
dram_tpr2 = 0x22a00
dram_tpr3 = 0x0
dram_tpr4 = 0x0
dram_tpr5 = 0x0
dram_emr1 = 0x0
dram_emr2 = 0x10
dram_emr3 = 0x0
[nand_para]
nand_used = 1
nand_we = port:PC00<2><default><default><default>
nand_ale = port:PC01<2><default><default><default>
nand_cle = port:PC02<2><default><default><default>
nand_ce1 = port:PC03<2><default><default><default>
nand_ce0 = port:PC04<2><default><default><default>
nand_nre = port:PC05<2><default><default><default>
nand_rb0 = port:PC06<2><default><default><default>
nand_rb1 = port:PC07<2><default><default><default>
nand_d0 = port:PC08<2><default><default><default>
nand_d1 = port:PC09<2><default><default><default>
nand_d2 = port:PC10<2><default><default><default>
nand_d3 = port:PC11<2><default><default><default>
nand_d4 = port:PC12<2><default><default><default>
nand_d5 = port:PC13<2><default><default><default>
nand_d6 = port:PC14<2><default><default><default>
nand_d7 = port:PC15<2><default><default><default>
nand_wp =
nand_ce2 =
nand_ce3 =
nand_ce4 =
nand_ce5 =
nand_ce6 =
nand_ce7 =
nand_spi =
nand_ndqs = port:PC19<2><default><default><default>
good_block_ratio = 0
[mali_para]
mali_used = 1
mali_clkdiv = 2
[twi0_para]
twi0_used = 1
twi0_scl = port:PB00<2><default><default><default>
twi0_sda = port:PB01<2><default><default><default>
[twi1_para]
twi1_used = 1
twi1_scl = port:PB15<2><default><default><default>
twi1_sda = port:PB16<2><default><default><default>
[twi2_para]
twi2_used = 1
twi2_scl = port:PB17<2><default><default><default>
twi2_sda = port:PB18<2><default><default><default>
[uart_para0]
uart_used = 0
uart_port = 0
uart_type = 2
uart_tx = port:PF02<4><1><default><default>
uart_rx = port:PF04<4><1><default><default>
[uart_para1]
uart_used = 1
uart_port = 1
uart_type = 2
uart_tx = port:PG03<4><1><default><default>
uart_rx = port:PG04<4><1><default><default>
[uart_para2]
uart_used = 0
uart_port = 2
uart_type = 2
uart_tx =
uart_rx =
[uart_para3]
uart_used = 1
uart_port = 3
uart_type = 4
uart_tx = port:PG09<3><1><default><default>
uart_rx = port:PG10<3><1><default><default>
uart_cts = port:PG11<3><1><default><default>
uart_rts = port:PG12<3><1><default><default>
[spi0_para]
spi_used = 0
spi_cs_bitmap = 1
spi_cs0 = port:PC03<3><default><default><default>
spi_sclk = port:PC02<3><default><default><default>
spi_mosi = port:PC00<3><default><default><default>
spi_miso = port:PC01<3><default><default><default>
[spi1_para]
spi_used = 0
spi_cs0 = port:PG09<2><default><default><default>
spi_cs1 = port:PG13<2><default><default><default>
spi_sclk = port:PG10<2><default><default><default>
spi_mosi = port:PG11<2><default><default><default>
spi_miso = port:PG12<2><default><default><default>
[spi2_para]
spi_used = 1
spi_cs0 = port:PE00<4><default><default><default>
spi_sclk = port:PE01<4><default><default><default>
spi_mosi = port:PE02<4><default><default><default>
spi_miso = port:PE03<4><default><default><default>
[spi_devices]
spi_dev_num = 1
[spi_board0]
modalias = "spidev"
max_speed_hz = 50000000
bus_num = 2
chip_select = 0
mode = 3
[rtp_para]
rtp_used = 1
rtp_screen_size = 5
rtp_regidity_level = 5
rtp_press_threshold_enable = 0
rtp_press_threshold = 0x1f40
rtp_sensitive_level = 0xf
rtp_exchange_x_y_flag = 0
[ctp_para]
ctp_used = 0
ctp_name = "ft5x_ts"
ctp_twi_id = 2
ctp_twi_addr = 0x70
ctp_screen_max_x = 800
ctp_screen_max_y = 480
ctp_revert_x_flag = 0
ctp_revert_y_flag = 0
ctp_exchange_x_y_flag = 0
ctp_int_port = port:PH21<6><default><default><default>
ctp_wakeup = port:PB13<1><default><default><1>
ctp_io_port = port:PH21<0><default><default><default>
[tkey_para]
tkey_used = 0
tkey_name = "hv_keypad"
tkey_twi_id = 2
tkey_twi_addr = 0x62
tkey_int =
[motor_para]
motor_used = 0
motor_shake =
[disp_init]
disp_init_enable = 1
disp_mode = 0
screen0_output_type = 1
screen0_output_mode = 4
screen1_output_type = 1
screen1_output_mode = 4
fb0_framebuffer_num = 2
fb0_format = 10
fb0_pixel_sequence = 0
fb0_scaler_mode_enable = 0
fb1_framebuffer_num = 2
fb1_format = 10
fb1_pixel_sequence = 0
fb1_scaler_mode_enable = 0
[lcd0_para]
lcd_used = 1
lcd_driver_name = "cpu_st7735s"
lcd_x = 128
lcd_y = 160
lcd_dclk_freq = 4
lcd_pwm_not_used = 0
lcd_pwm_ch = 0
lcd_pwm_freq = 10000
lcd_pwm_pol = 0
lcd_if = 1
lcd_hbp = 43
lcd_ht = 531
lcd_vbp = 12
lcd_vt = 576
lcd_hv_if = 0
lcd_hv_smode = 0
lcd_hv_s888_if = 0
lcd_hv_syuv_if = 0
lcd_hv_vspw = 1
lcd_hv_hspw = 1
lcd_lvds_ch = 0
lcd_lvds_mode = 0
lcd_lvds_bitwidth = 0
lcd_lvds_io_cross = 0
lcd_cpu_if = 7
lcd_frm = 2
lcd_io_cfg0 = 0
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0 = 0x0
lcd_gamma_tbl_1 = 0x10101
lcd_gamma_tbl_255 = 0xffffff
lcd_bl_en_used = 1
lcd_bl_en = port:PD15<1><0><default><0>
lcd_power_used = 1
lcd_power = port:PD14<1><0><default><1>
lcd_pwm_used = 0
lcd_gpio_0 = port:PD13<1><0><default><1>
lcdd3 = port:PD03<2><0><default><default>
lcdd4 = port:PD04<2><0><default><default>
lcdd5 = port:PD05<2><0><default><default>
lcdd6 = port:PD06<2><0><default><default>
lcdd7 = port:PD07<2><0><default><default>
lcdd10 = port:PD10<2><0><default><default>
lcdd11 = port:PD11<2><0><default><default>
lcdd12 = port:PD12<2><0><default><default>
lcdclk = port:PD24<2><0><default><default>
lcdde = port:PD25<2><0><default><default>
lcdhsync = port:PD26<2><0><default><default>
lcdvsync = port:PD27<2><0><default><default>
[tv_out_dac_para]
dac_used = 1
dac0_src = 0
[hdmi_para]
hdmi_used = 0
[csi0_para]
csi_used = 0
csi_mode = 0
csi_dev_qty = 1
csi_stby_mode = 1
csi_mname = "gc0308"
csi_twi_id = 2
csi_twi_addr = 0x42
csi_if = 0
csi_vflip = 0
csi_hflip = 1
csi_iovdd = ""
csi_avdd = ""
csi_dvdd = ""
csi_flash_pol = 1
csi_mname_b = ""
csi_twi_id_b = 1
csi_twi_addr_b = 0x78
csi_if_b = 0
csi_vflip_b = 1
csi_hflip_b = 0
csi_iovdd_b = ""
csi_avdd_b = ""
csi_dvdd_b = ""
csi_flash_pol_b = 1
csi_ck = port:PE01<3><default><default><default>
csi_hsync = port:PE02<3><default><default><default>
csi_vsync = port:PE03<3><default><default><default>
csi_d0 = port:PE04<3><default><default><default>
csi_d1 = port:PE05<3><default><default><default>
csi_d2 = port:PE06<3><default><default><default>
csi_d3 = port:PE07<3><default><default><default>
csi_d4 = port:PE08<3><default><default><default>
csi_d5 = port:PE09<3><default><default><default>
csi_d6 = port:PE10<3><default><default><default>
csi_d7 = port:PE11<3><default><default><default>
csi_reset = port:power3<1><default><default><0>
csi_power_en =
csi_flash =
csi_af_en =
csi_reset_b =
csi_power_en_b =
csi_stby_b =
csi_flash_b =
csi_af_en_b =
[csi1_para]
csi_used = 0
csi_mode = 0
csi_dev_qty = 1
csi_stby_mode = 1
csi_mname = ""
csi_twi_id = 1
csi_twi_addr = 0xba
csi_if = 0
csi_vflip = 0
csi_hflip = 0
csi_iovdd = ""
csi_avdd = ""
csi_dvdd = ""
csi_flash_pol = 1
csi_mname_b = ""
csi_twi_id_b = 1
csi_twi_addr_b = 0x78
csi_if_b = 0
csi_vflip_b = 1
csi_hflip_b = 0
csi_iovdd_b = ""
csi_avdd_b = ""
csi_dvdd_b = ""
csi_flash_pol_b = 1
csi_reset =
csi_power_en =
csi_stby =
csi_flash =
csi_af_en =
csi_reset_b =
csi_power_en_b =
csi_stby_b =
csi_flash_b =
csi_af_en_b =
[mmc0_para]
sdc_used = 0
sdc_detmode = 4
bus_width = 4
sdc_d1 = port:PF00<2><1><2><default>
sdc_d0 = port:PF01<2><1><2><default>
sdc_clk = port:PF02<2><1><2><default>
sdc_cmd = port:PF03<2><1><2><default>
sdc_d3 = port:PF04<2><1><2><default>
sdc_d2 = port:PF05<2><1><2><default>
sdc_det = port:PG00<0><1><default><default>
sdc_use_wp = 0
sdc_wp =
[mmc1_para]
sdc_used = 0
sdc_detmode =
bus_width =
sdc_cmd =
sdc_clk =
sdc_d0 =
sdc_d1 =
sdc_d2 =
sdc_d3 =
sdc_det =
sdc_use_wp =
sdc_wp =
[mmc2_para]
sdc_used = 1
sdc_detmode = 3
bus_width = 4
sdc_cmd = port:PE08<4><1><2><default>
sdc_clk = port:PE09<4><1><2><default>
sdc_d0 = port:PE04<4><1><2><default>
sdc_d1 = port:PE05<4><1><2><default>
sdc_d2 = port:PE06<4><1><2><default>
sdc_d3 = port:PE07<4><1><2><default>
sdc_det =
sdc_use_wp = 0
sdc_wp =
[ms_para]
ms_used = 0
ms_bs =
ms_clk =
ms_d0 =
ms_d1 =
ms_d2 =
ms_d3 =
ms_det =
[keypad_para]
kp_used = 0
kp_in_size =
kp_out_size =
kp_in0 =
kp_in1 =
kp_in2 =
kp_in3 =
kp_in4 =
kp_in5 =
kp_in6 =
kp_in7 =
kp_out0 =
kp_out1 =
kp_out2 =
kp_out3 =
kp_out4 =
kp_out5 =
kp_out6 =
kp_out7 =
[usbc0]
usb_used = 1
usb_port_type = 0
usb_detect_type = 0
usb_id_gpio = port:PG02<0><1><default><default>
usb_drv_vbus_gpio = port:PB03<1><0><default><0>
usb_host_init_state = 0
[usbc1]
usb_used = 1
usb_port_type = 1
usb_detect_type = 0
usb_id_gpio =
usb_det_vbus_gpio =
usb_drv_vbus_gpio =
usb_drv_vbus_1_gpio =
usb_host_init_state = 0
[usb_feature]
vendor_id = 6353
mass_storage_id = 1
adb_id = 2
manufacturer_name = "USB Developer"
product_name = "Android"
serial_number = "20080411"
[msc_feature]
vendor_name = "USB 2.0"
product_name = "USB Flash Driver"
release = 100
luns = 3
[gsensor_para]
gsensor_used = 0
gsensor_name = "bma222"
gsensor_twi_id = 1
gsensor_twi_addr = 0x18
gsensor_int1 =
gsensor_int2 =
[gps_para]
gps_used = 0
gps_spi_id =
gps_spi_cs_num =
gps_lradc =
gps_clk =
gps_sign =
gps_mag =
gps_vcc_en =
gps_osc_en =
gps_rx_en =
[rf_para]
module_num = 10
module_power1 = "axp20_ldo3"
module_power1_vol = 3300000
module_power2 = ""
module_power2_vol =
module_power3 = ""
module_power3_vol =
power_switch =
chip_en =
lpo_use_apclk = ""
[wifi_para]
wifi_used = 1
wifi_sdc_id = 2
wifi_usbc_id = 1
wifi_usbc_type = 1
wl_reg_on = port:PD18<1><default><default><0>
wl_host_wake = port:PG00<6><default><default><0>
wl_host_wake_int_num = 0
wl_host_wake_invert = 0
[bt_para]
bt_used = 1
bt_uart_id = 1
bt_rst_n = port:PE10<1><default><default><0>
bt_wake = port:PB03<1><default><default><0>
bt_host_wake = port:PG01<6><default><default><0>
bt_host_wake_invert = 0
[3g_para]
3g_used = 0
3g_name =
3g_usbc_num =
3g_on_off =
3g_reset =
3g_poweron =
3g_wakeup_out =
3g_wakeup_in =
[gy_para]
gy_used = 0
gy_twi_id = 1
gy_twi_addr = 0
gy_int1 =
gy_int2 =
[ls_para]
ls_used = 1
ls_name = "ltr501als"
ls_twi_id = 1
ls_twi_addr =
ls_int =
[compass_para]
compass_used = 0
compass_twi_id =
compass_twi_addr =
compass_int =
[i2s_para]
i2s_used = 0
i2s_channel =
i2s_mclk =
i2s_bclk =
i2s_lrclk =
i2s_dout0 =
i2s_dout1 =
i2s_dout2 =
i2s_dout3 =
i2s_din =
[spdif_para]
spdif_used = 0
spdif_mclk =
spdif_dout =
spdif_din =
[audio_para]
audio_used = 1
capture_used = 1
audio_lr_change = 0
audio_pa_ctrl = port:PD20<1><0><default><0>
[ir_para]
ir_used = 0
ir0_rx = port:PB04<2><default><default><default>
[rtc_para]
rtc_used = 1
rtc_name = "pcf8563"
rtc_twi_id = 1
rtc_twi_addr = 81
[pmu_para]
pmu_used = 1
pmu_twi_addr = 52
pmu_twi_id = 0
pmu_irq_id = 0
pmu_battery_rdc = 180
pmu_battery_cap = 3500
pmu_init_chgcur = 1000
pmu_earlysuspend_chgcur = 1000
pmu_suspend_chgcur = 1000
pmu_resume_chgcur = 1000
pmu_shutdown_chgcur = 1000
pmu_init_chgvol = 4200
pmu_init_chgend_rate = 15
pmu_init_chg_enabled = 1
pmu_init_adc_freq = 100
pmu_init_adc_freqc = 100
pmu_init_chg_pretime = 50
pmu_init_chg_csttime = 720
pmu_bat_para1 = 0
pmu_bat_para2 = 0
pmu_bat_para3 = 0
pmu_bat_para4 = 0
pmu_bat_para5 = 2
pmu_bat_para6 = 3
pmu_bat_para7 = 9
pmu_bat_para8 = 14
pmu_bat_para9 = 22
pmu_bat_para10 = 34
pmu_bat_para11 = 49
pmu_bat_para12 = 56
pmu_bat_para13 = 71
pmu_bat_para14 = 82
pmu_bat_para15 = 89
pmu_bat_para16 = 98
pmu_usbvol_limit = 0
pmu_usbcur_limit = 0
pmu_usbvol = 0
pmu_usbcur = 0
pmu_usbvol_pc = 0
pmu_usbcur_pc = 0
pmu_pwroff_vol = 3300
pmu_pwron_vol = 2900
pmu_pekoff_time = 10000
pmu_pekoff_en = 1
pmu_peklong_time = 1500
pmu_pekon_time = 1000
pmu_pwrok_time = 64
pmu_pwrnoe_time = 2000
pmu_intotp_en = 1
pmu_used2 = 0
pmu_adpdet =
pmu_init_chgcur2 = 1000
pmu_earlysuspend_chgcur2 = 1000
pmu_suspend_chgcur2 = 1200
pmu_resume_chgcur2 = 1000
pmu_shutdown_chgcur2 = 1200
pmu_suspendpwroff_vol = 3500
pmu_batdeten = 1
[recovery_key]
key_min = 4
key_max = 6
[dvfs_table]
max_freq = 1008000000
min_freq = 60000000
LV_count = 7
LV1_freq = 1104000000
LV1_volt = 1500
LV2_freq = 1008000000
LV2_volt = 1400
LV3_freq = 912000000
LV3_volt = 1350
LV4_freq = 864000000
LV4_volt = 1300
LV5_freq = 624000000
LV5_volt = 1200
LV6_freq = 576000000
LV6_volt = 1200
LV7_freq = 432000000
LV7_volt = 1200
[boot_disp]
output_disp = 0
output_type = 1
output_mode = 5
auto_hpd = 1
应该很多全志的设备都可以用这个方法提取设备树,有了设备树就可以进行下一步了,从lcd节点可以看出屏幕的驱动应该是st7735s的,有了屏幕引脚定义和驱动就可以点亮屏幕了.
最近编辑记录 917346285aa (2024-11-07 13:53:38)
离线
在源码路径.\lichee_a13\linux-3.0\drivers\video\sun5i\lcd\lcd_bak有一个示例文件cpu_320x240_kgm281i0.c
我们可以模仿这个文件写一个st7735s的,主要就是屏幕的初始化和屏幕的刷新函数不太一样.
#define LCD_PARA_USE_CONFIG //这个宏定义是选择从全志的设备树读取LCD屏幕的参数还是从当前文件写死参数,一般是选择从设备树,不然修改的时候很麻烦.
我们主要是修改一下init函数,屏幕的分辨率等等参数就可以了,感兴趣的可以看源码,记得修改了源码以后设备树文件也要对应修改.
离线
开机显示包括两部分,全志的sdk还有一个boot1,它是比uboot先运行的,所以要想显示开机logo,boot1文件夹下边也需要修改一个文件
文件路径:.\lichee_a13\boot\boot1\driver\drv_de\de_bsp\lcd下的lcd0_panel_cfg.c
这个文件直接复制linux内核文件夹的那个就可以.
替换完成以后在编译运行就可以看到开机logo了
离线