project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp: Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem. sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately. sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades. sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for fastboot. Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
65 lines
2.0 KiB
Python
65 lines
2.0 KiB
Python
import os
|
|
import configparser
|
|
|
|
def GetStringFromConfig(bsp_dir, string):
|
|
try:
|
|
config = open(bsp_dir + '/rtconfig.h', 'r')
|
|
except IOError:
|
|
print('no found rtconfig.h, use scons --menuconfig before compile')
|
|
else:
|
|
cfg_list = config.readlines()
|
|
for cfg in cfg_list:
|
|
if cfg.find(string) != -1:
|
|
target = cfg[cfg.find('"'):-1]
|
|
target = eval(target)
|
|
config.close()
|
|
return target
|
|
print('no found ' + string + ' in rtconfig.h, you must define this in kconfig of board')
|
|
|
|
return ''
|
|
|
|
def GetRTConfigOption(bsp_dir, option):
|
|
value = False
|
|
try:
|
|
config = open(bsp_dir + '/rtconfig.h', 'r')
|
|
except IOError:
|
|
print('no found rtconfig.h, use scons --menuconfig before compile')
|
|
else:
|
|
cfg_list = config.readlines()
|
|
for cfg in cfg_list:
|
|
if cfg.find('#define ' + option) != -1:
|
|
cfg = cfg.rstrip('\n')
|
|
values = cfg.split(' ')
|
|
|
|
if len(values) == 3:
|
|
value = values[2]
|
|
else:
|
|
value = True
|
|
|
|
config.close()
|
|
return value
|
|
|
|
return value
|
|
|
|
def GetImageSetting(bsp_dir):
|
|
board = GetStringFromConfig(bsp_dir, 'RT_BOARD_NAME')
|
|
path = 'board/{dir}/setting.ini'.format(dir = board)
|
|
if (bsp_dir.endswith('/') == False):
|
|
bsp_dir += '/'
|
|
if os.path.exists(bsp_dir + path) == True:
|
|
return path
|
|
else:
|
|
return 'board/common/setting.ini'
|
|
|
|
def ParsePartitionStart(bsp_dir, name):
|
|
start = -1
|
|
path = GetImageSetting(bsp_dir)
|
|
configer = configparser.ConfigParser()
|
|
configer.read(path)
|
|
for section in configer.sections():
|
|
if (configer.has_option(section, 'Name')):
|
|
if configer.get(section, 'Name') == name:
|
|
sector = int(configer.get(section, 'PartOffset'), 16)
|
|
start = (sector + 1) * 512
|
|
return start
|