mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 04:17:09 +00:00
Merge branch '2022-06-28-assorted-fixes'
- Fix a squashfs security issue, an i2c access security issue and fix NAND booting on imx8mn_bsh_smm_s2
This commit is contained in:
commit
a063429c17
4 changed files with 23 additions and 14 deletions
24
cmd/i2c.c
24
cmd/i2c.c
|
@ -200,10 +200,10 @@ void i2c_init_board(void)
|
|||
*
|
||||
* Returns the address length.
|
||||
*/
|
||||
static uint get_alen(char *arg, int default_len)
|
||||
static uint get_alen(char *arg, uint default_len)
|
||||
{
|
||||
int j;
|
||||
int alen;
|
||||
uint j;
|
||||
uint alen;
|
||||
|
||||
alen = default_len;
|
||||
for (j = 0; j < 8; j++) {
|
||||
|
@ -247,7 +247,7 @@ static int do_i2c_read(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
uint chip;
|
||||
uint devaddr, length;
|
||||
int alen;
|
||||
uint alen;
|
||||
u_char *memaddr;
|
||||
int ret;
|
||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||
|
@ -301,7 +301,7 @@ static int do_i2c_write(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
uint chip;
|
||||
uint devaddr, length;
|
||||
int alen;
|
||||
uint alen;
|
||||
u_char *memaddr;
|
||||
int ret;
|
||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||
|
@ -469,8 +469,8 @@ static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
uint chip;
|
||||
uint addr, length;
|
||||
int alen;
|
||||
int j, nbytes, linebytes;
|
||||
uint alen;
|
||||
uint j, nbytes, linebytes;
|
||||
int ret;
|
||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||
struct udevice *dev;
|
||||
|
@ -589,9 +589,9 @@ static int do_i2c_mw(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
uint chip;
|
||||
ulong addr;
|
||||
int alen;
|
||||
uint alen;
|
||||
uchar byte;
|
||||
int count;
|
||||
uint count;
|
||||
int ret;
|
||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||
struct udevice *dev;
|
||||
|
@ -676,8 +676,8 @@ static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
uint chip;
|
||||
ulong addr;
|
||||
int alen;
|
||||
int count;
|
||||
uint alen;
|
||||
uint count;
|
||||
uchar byte;
|
||||
ulong crc;
|
||||
ulong err;
|
||||
|
@ -985,7 +985,7 @@ static int do_i2c_loop(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
char *const argv[])
|
||||
{
|
||||
uint chip;
|
||||
int alen;
|
||||
uint alen;
|
||||
uint addr;
|
||||
uint length;
|
||||
u_char bytes[16];
|
||||
|
|
|
@ -30,8 +30,10 @@ CONFIG_SPL_BOARD_INIT=y
|
|||
CONFIG_SPL_BOOTROM_SUPPORT=y
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
|
||||
CONFIG_SPL_DMA=y
|
||||
CONFIG_SPL_I2C=y
|
||||
CONFIG_SPL_MTD_SUPPORT=y
|
||||
CONFIG_SPL_NAND_SUPPORT=y
|
||||
CONFIG_SPL_POWER=y
|
||||
CONFIG_SPL_WATCHDOG=y
|
||||
CONFIG_SYS_PROMPT="> "
|
||||
|
@ -41,6 +43,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
|
|||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
|
||||
CONFIG_MTDPARTS_DEFAULT="gpmi-nand:64m(nandboot),16m(nandfit),32m(nandkernel),1m(nanddtb),8m(nandtee),-(nandrootfs)"
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_OF_CONTROL=y
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
|
@ -65,6 +68,9 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
|
|||
CONFIG_NAND_MXS=y
|
||||
CONFIG_NAND_MXS_DT=y
|
||||
CONFIG_SYS_NAND_ONFI_DETECTION=y
|
||||
CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
|
||||
CONFIG_SYS_NAND_U_BOOT_OFFS=0xD8000
|
||||
CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x4058000
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHY_NXP_TJA11XX=y
|
||||
CONFIG_DM_ETH=y
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <fs.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/compat.h>
|
||||
#include <memalign.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -725,7 +726,8 @@ static int sqfs_read_inode_table(unsigned char **inode_table)
|
|||
goto free_itb;
|
||||
}
|
||||
|
||||
*inode_table = malloc(metablks_count * SQFS_METADATA_BLOCK_SIZE);
|
||||
*inode_table = kcalloc(metablks_count, SQFS_METADATA_BLOCK_SIZE,
|
||||
GFP_KERNEL);
|
||||
if (!*inode_table) {
|
||||
ret = -ENOMEM;
|
||||
printf("Error: failed to allocate squashfs inode_table of size %i, increasing CONFIG_SYS_MALLOC_LEN could help\n",
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
#define NANDARGS \
|
||||
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
||||
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
"nandargs=setenv bootargs console=${console} " \
|
||||
"nandargs=setenv bootargs " \
|
||||
"${optargs} " \
|
||||
"mtdparts=${mtdparts} " \
|
||||
"root=${nandroot} " \
|
||||
"rootfstype=${nandrootfstype}\0" \
|
||||
"nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
|
||||
|
|
Loading…
Add table
Reference in a new issue