Directory:
Step1:
Boot the deivice,enter uboot cmdline(By pressing "Enter" before the system boots)
Step2: By "set bootargs"、"setenv" to set cmdline
Set device IP, server IP, please modify according to the actual situation:
isvp# setenv gatewayip 192.168.1.100
isvp# setenv ipaddr 192.168.1.1
isvp# setenv netmask 255.255.255.0
isvp# setenv serverip 192.168.1.200
Download the image file to the memory address 0x80600000.
isvp# tftpboot 0x80600000 uImage
Then, use the "bootm" command to start the kernel.
bootm 0x80600000
Notes: The above setting will be lost after reset the device, we can through the following operation to download uImage automatically by tftpboot.
isvp# setenv gatewayip 192.168.1.100
isvp# setenv ipaddr 192.168.1.1
isvp# setenv netmask 255.255.255.0
isvp# setenv serverip 192.168.1.200
isvp# setenv bootfile uImage
isvp# setenv bootcmd tftpboot\;bootm\;bootd
isvp# save
step1:
Boot the deivice,enter uboot cmdline(By pressing "Enter" before the system boots)
step2:
By "set bootargs"to set cmdline
isvp# set bootargs console=ttyS1,115200n8 mem=32M@0x0 ispmem=8M@0x5A00000 rmem=30M@0x6200000 init=/linuxrc ip=192.168.1.100:192.168.1.1:192.168.1.200:255.255.255.0 root=/dev/nfs nfsroot=193.169.4.2:/your/nfsroot/path rw
Then, use "boot" command to start, now we can mount the nfsroot network file system
Tips:The above operation needs to first build your server's TFTP and NFS services
mtd regions size,the isvp.h file (uboot/include/configs/isvp.h) displays the kernel parameters.
For 8M Flash,check CONFIG_SFC_NOR,the parameter introduced into our reference platform is defined as follows:
#define CONFIGBOOTARGS BOOTARGSCOMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(rootfs),-(appfs)"
mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(rootfs),-(appfs) is the MTD region situation, a ttal of 4 regions: uboot 256k,kernel 2.5M,rootfs(squashfs)2M. (appfs) has its own adaptive functions,If Flash is 8M,appfs region will automatically size itself to 3.25M;If Flash is 16M, its size will be 11.25M.
If you want to modify, please keep the total size unchanged, then modify according the format above. Commonly the size of uboot、kernel、and rootfs are fixed,It is not recommended for users to modify their size, users can adjust the size of appfs partition.
Sample 1
For 8M Flash,if you want to add a data region(1M),change it as follows:
#define CONFIGBOOTARGS BOOTARGSCOMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(rootfs),1024k(data),-(appfs)"
rmem size is also in uboot/include/configs/isvp.h.
#define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=39M@0x0 ispmem=5M@0x2700000 rmem=20M@0x2c00000
mem=39M@0x0 ispmem=5M@0x2400000 rmem=20M@0x2c00000 are the mem related settings
mem=36M@0x0,allocation of 36M memory to system fromm address 0.
ispmem=5M@0x2700000,allocation of 5M memory to isp fromm address 0x2700000(36M)
rmem=20M@0x2c00000,allocation of 20M memory to SDK fromm address 0x2c00000(41M)
T10 embedded in one piece64M memory, If you want to modify rmem,please keep the total size(64M) unchanged, then modify according the format above.
Sample:
If rmem is reduced by 4M,mem is amplified by 4M.
Commonly isp's size(8M) is unchanged,if you want to reduce the rmem,then mem has to be amplified. so mem's size is 43,and starts address 0. isp is still 8M,but the address starts at 43M position. If rmem is 13M,the address should start from 51M.
#define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=43M@0x0 ispmem=5M@0x2b00000 rmem=16M@0x3000000"
T10 has 2 MMC interfaces,MMC0一commonly used for TF card,MMC1 for SDIO WIFI。
First select MMC0 from menuconfig
Location:
-> Device Drivers
-> MMC/SD/SDIO card support (MMC [=y])
-> Ingenic(XBurst) MMC/SD Card Controller(MSC) v1.2 support
select JZMMC_V12 MMC0
JZMMC_V12 GPIO function select select GPIO B,with 4bit
msc0 max frequency 写48000000
You may need to configure these pins:
mango board for example,change the path to:arch/mips/xburst/soc_t10/chip_t10/isvp/mango/board.h,
/* ****************************GPIO MMC START******************************** */
#define GPIO_MMC_RST_N -1
#define GPIO_MMC_RST_N_LEVEL LOW_ENABLE
#define GPIO_MMC_CD_N GPIO_PB(27)
#define GPIO_MMC_CD_N_LEVEL LOW_ENABLE
#define GPIO_MMC_PWR -1
#define GPIO_MMC_PWR_LEVEL LOW_ENABLE
#define GPIO_MMC_WP_N -1
#define GPIO_MMC_WP_N_LEVEL LOW_ENABLE
/* ****************************GPIO MMC END******************************** */
If we want to add a PWR pin(PA29 high is valid),modify as follows:
/* ****************************GPIO MMC START******************************** */
#define GPIO_MMC_RST_N -1
#define GPIO_MMC_RST_N_LEVEL LOW_ENABLE
#define GPIO_MMC_CD_N GPIO_PB(27)
#define GPIO_MMC_CD_N_LEVEL LOW_ENABLE
#define GPIO_MMC_PWR GPIO_PA(29)
#define GPIO_MMC_PWR_LEVEL HIGH_ENABLE
#define GPIO_MMC_WP_N -1
#define GPIO_MMC_WP_N_LEVEL LOW_ENABLE
/* ****************************GPIO MMC END******************************** */
Notes: set to -1 all the GPIO which is not in use.
Currently supports the following formats.
Use the arrow keys to navigate this window or press the hotkey of x
x the item you wish to select followed by the <SPACE BAR>. Press x
x <?> for additional information about this option. x
x x ( ) Gzip x x
x x ( ) Bzip2 x x
x x (X) LZMA x x
x x ( ) LZO x x
x x x x
Execute make menuconfig select the desired compression format. Here recommended LZMA compression, because high compression efficiency.
x Location: x
x -> General setup x
x -> Kernel compression mode (<choice> [=y])
Notes:After selecting a compression format, you need to check whether the uboot support for such a format decompression, which GZIP supported default.
Inspection method:
Open the configuration file, check whether the relevant macro definition is added, if not, you need to add it.
t10 => include/configs/isvp.h
t20 => include/configs/isvp_t20.h
Explain:
CONFIG_GZIP appropriate gzip format
CONFIG_LZMA appropriate lzma format
CONFIG_BZIP2 appropriate bzip2 format
CONFIG_LZO appropriate lzo format
1.Pins configuration
You may need to configure these pins:
the mango board for example,change the path:arch/mips/xburst/soc_t10/chip_t10/isvp/mango/board.h,
/* ****************************GPIO USB START******************************** */
#define GPIO_USB_ID -1
#define GPIO_USB_ID_LEVEL LOW_ENABLE
#define GPIO_USB_DETE -1
#define GPIO_USB_DETE_LEVEL LOW_ENABLE
#define GPIO_USB_DRVVBUS -1
#define GPIO_USB_DRVVBUS_LEVEL HIGH_ENABLE
/* ****************************GPIO USB END********************************** */
Users can configure GPIO according to their need. Set to -1 the ones which are not used.
2.Function configuration
In menuconfig
OTG Host configuration
Location:
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
-> DesignWare USB2 DRD Core Support (USB_JZ_DWC2 [=y])
-> Driver Mode
Select Host Mode Only
Host and device configuration
First step:
Location:
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
-> USB Gadget Drivers (<choice> [=y])
select Android Composite Gadget
second step:
Location:
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
-> DesignWare USB2 DRD Core Support (USB_JZ_DWC2 [=y])
-> Driver Mode
select Both Host and Device
BCM modules mainly encapsulate four board level power management interface function,bcm_wlan_power_on()、bcm_wlan_power_on()、bcm_manual_detect(),
bcm_customer_wlan_get_oob_irq() implementation of powering on/off the WIFI chip, SDIO's detection, power on, reset and others GPIO has done a macro definition,if the customer wants to modify, only the macro below needs modifications:
symbol: bcm_pm_core [=y]
prompt: bcm module power control core drive
location:
->device drivers
->misc device
defined at drivers/misc/kconfig:543
Those methods are in the following file:arch/mips/xburst/soc_t10/chip_t10/isvp/common/bcm_power_control.c.
About mango board level:
macro definition :arch/mips/xburst/soc_t10/chip_t10/isvp/mango/board.h
/* ****************************GPIO WIFI START******************************* */
#define WL_WAKE_HOST GPIO_PB(28)
#define WL_REG_EN GPIO_PC(16)
#define WL_32K_EN GPIO_PB(18)
#define WL_MMC_NUM 1 //sdio use MMC1
#define WLAN_PWR_EN (-1)
#define BCM_PWR_EN (-1)
/* ****************************GPIO WIFI END********************************* */
If users need to transplant the corresponding WIFI driver(the driver can be separated from the board), they just need to apply the four functions seen ealier in the driver corresponding position.
the current Kernel supports AP6181, add it as follows:
Symbol: BCMDHD_AP6181 [=y]
Type : tristate
Prompt: Broadcom FullMAC wireless cards support
Location:
->Devices Drivers
->Network devices support (NETDEVICE [=y])
->Wireless LAN (WLAN [=y])
select MMC1 from menuconfig
Location:
-> Device Drivers
-> MMC/SD/SDIO card support (MMC [=y])
-> Ingenic(XBurst) MMC/SD Card Controller(MSC) v1.2 support
select JZMMC_V12 MMC1
JZMMC_V12 GPIO function select select GPIO C,with 4bit
msc0 max frequency write 24000000
mango board currently does not add the audio part of the function, if the user wants to add it in their own board, they can do it according to the instructions below:
1.Pins configuration
You may need to configure this pin:
path:arch/mips/xburst/soc_t10/chip_t10/isvp/mango/board.h,
#define GPIO_SPEAKER_EN -1 /*speaker enable gpio*/
#define GPIO_SPEAKER_EN_LEVEL HIGH_ENABLE
mango board as example,path:arch/mips/xburst/soc_t10/chip_t10/isvp/mango/board.h,
2.menuconfig, add audio module
Symbol: T10_INTERNAL_CODEC [=y]
Type : boolean
Prompt: t10 internal codec
Location:
-> Device Drivers
-> Sound card support (SOUND [=y])
-> Open Sound System (DEPRECATED) (SOUND_PRIME [=y])
-> Open Sound System of xburst (SOUND_OSS_XBURST [=y])
-> Jz On-Chip I2S driver (SOUND_JZ_I2S_V12 [=y])
-> xburst internal coedc (JZ_INTERNAL_CODEC_V12 [=y])
1.Create a board files folder
Reference platform board level path: arch/mips/xburst/soc-t10/chip-t10/isvp/
test_board as example
mkdir arch/mips/xburst/soc-t10/chip-t10/isvp/test_board
Make a copy of all the files on our reference platform (mango board)
cp arch/mips/xburst/soc-t10/chip-t10/isvp/mango/* arch/mips/xburst/soc-t10/chip-t10/isvp/test_board
2.Modify the files under this path:arch/mips/xburst/soc-t10/chip-t10/isvp/ (Makefile、Kconfig),make our board files ready to be compiled.
Kconfig:
choice
prompt "Board type"
depends on PLATFORM_ISVP
default BOARD_MANGO
config BOARD_MANGO
bool "Mango"
depends on PLATFORM_ISVP
config BOARD_TEST_BOARD
bool "test_board"
depends on PLATFORM_ISVP
endchoice
config BOARD_NAME
string
default "mango" if BOARD_MANGO
default "test_board" if BOARD_TEST_BOARD
Makefile:
CFLAGS_KERNEL += -I$(srctree)/arch/mips/xburst/soc-t10/chip-t10/$(CONFIG_PRODUCT_NAME)/$(CONFIG_BOARD_NAME)
obj-y += common/
obj-$(CONFIG_BOARD_MANGO) += $(CONFIG_BOARD_NAME)/
obj-$(CONFIG_BOARD_TEST_BOARD) += $(CONFIG_BOARD_NAME)/
3.Add a defconig file
Copy the reference platform "defconig" file
cp arch/mips/configs/isvp_mango_defconfig arch/mips/configs/isvp_test_board_defconfig
modify the file(arch/mips/configs/isvp_test_board_defconfig),as you wish.
# CONFIG_SOC_T15 is not set
CONFIG_SOC_T10=y
CONFIG_JZRISC=y
CONFIG_BOARD_NAME="mango"
CONFIG_PRODUCT_NAME="isvp"
CONFIG_CHIP_T10=y
# CONFIG_BOARD_MUSCA is not set
CONFIG_PLATFORM_ISVP=y
CONFIG_BOARD_MANGO=y
CONFIG_EXTAL_CLOCK=24
modify CONFIG_BOARD_NAME、CONFIG_BOARD_MANGO,Notes: these modifications have to be done according to the Kconfig's modifications (identical)
# CONFIG_SOC_T15 is not set
CONFIG_SOC_T10=y
CONFIG_JZRISC=y
CONFIG_BOARD_NAME="test_board"
CONFIG_PRODUCT_NAME="isvp"
CONFIG_CHIP_T10=y
# CONFIG_BOARD_MUSCA is not set
CONFIG_PLATFORM_ISVP=y
CONFIG_BOARD_TEST_BOARD=y
CONFIG_EXTAL_CLOCK=24
After all that, you have your new board files ready, so you can use them to create your own board.
SDIO WiFi, If you want to switch to Host AP function, you need to replace the firmware. Normal WiFi function and Host AP function of the firmware are apart, in switching mode you must first switch the firmware. AP6181,the method is as follows:
First specify the firmware address path,
echo "/lib/firmware/fw_bcm40181a2_apsta.bin">/sys/module/bcmdhd/parameters/firmware_path
when WiFi is called,it will load the firmware from the corresponding path, and do the corresponding functions.
uboot and kernel need to be added synchronously.
uboot:
vi drivers/spi/jz_spi.h
Find the table (jz_spi_support_table),insert the new flash,a copy of an existing flash configuration can be used but modifications are needed: name、id_manufactory、sector_size、size,sector_size is the flash's wipe size(64K is recommended, it improves cleaning speed. If it doesn't support 64K, just use 32K)
Add a 8M flash EN25QH64:
{
.name = "EN25QH64",
.id_manufactory = 0x1c7017,
.page_size = 256,
.sector_size = (32 * 1024),
.addr_size = 3,
.size = (8 * 1024 * 1024),
.quad_mode = {
.dummy_byte = 8,
.RDSR_CMD = CMD_RDSR_1,
.WRSR_CMD = CMD_WRSR_1,
.RDSR_DATE = 0x2,//the data is write the spi status register for QE bit
.RD_DATE_SIZE = 1,
.WRSR_DATE = 0x2,//this bit should be the flash QUAD mode enable
.WD_DATE_SIZE = 1,
.cmd_read = CMD_QUAD_READ,
#ifdef CONFIG_JZ_SFC
.sfc_mode = TRAN_SPI_QUAD,
#endif
},
},
If you want to use the four-line mode, set the quad_mode parameter according to the spec definition.
T10:
vi arch/mips/xburst/soc-t10/chip-t10/isvp/common/spi_bus.c
T20:
vi arch/mips/xburst/soc-t20/chip-t20/isvp/common/spi_bus.c
Find the spi_nor_pdata. The process is similar to uboot. The names are not the same, id refers to uboot's id_manufactory,erasesize refers to uboot's sector_size,chipsize refers to uboot's size,pagesieze and sectorsize remain the same.
{
.name = "EN25QH64",
.pagesize = 256,
.sectorsize = 4 * 1024,
.chipsize = 8192 * 1024,
.erasesize = 32 * 1024,//4 * 1024,
.id = 0x1c7017,
.block_info = flash_block_info,
.num_block_info = ARRAY_SIZE(flash_block_info),
.addrsize = 3,
.pp_maxbusy = 3, /* 3ms */
.se_maxbusy = 400, /* 400ms */
.ce_maxbusy = 8 * 10000, /* 80s */
.st_regnum = 3,
#ifdef CONFIG_SPI_QUAD
.quad_mode = &flash_quad_mode[0],
#endif
},
Reserved memory is divided into two parts:ispmem及rmem.
The Kernel's default config has a certain margin, but the current product often requires the kernel to be reduced in order to release more space. The following steps are a few options available for reduction and description:
Notes:The depth of the kernel has a certain technical difficulty, so users try to understand the configuration as deep as possible, then you can face the technical difficulty situations.