mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01: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
24
cmd/i2c.c
24
cmd/i2c.c
@ -200,10 +200,10 @@ void i2c_init_board(void)
|
|||||||
*
|
*
|
||||||
* Returns the address length.
|
* Returns the address length.
|
||||||
*/
|
*/
|
||||||
static uint get_alen(char *arg, int default_len)
|
static uint get_alen(char *arg, uint default_len)
|
||||||
{
|
{
|
||||||
int j;
|
uint j;
|
||||||
int alen;
|
uint alen;
|
||||||
|
|
||||||
alen = default_len;
|
alen = default_len;
|
||||||
for (j = 0; j < 8; j++) {
|
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 chip;
|
||||||
uint devaddr, length;
|
uint devaddr, length;
|
||||||
int alen;
|
uint alen;
|
||||||
u_char *memaddr;
|
u_char *memaddr;
|
||||||
int ret;
|
int ret;
|
||||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
#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 chip;
|
||||||
uint devaddr, length;
|
uint devaddr, length;
|
||||||
int alen;
|
uint alen;
|
||||||
u_char *memaddr;
|
u_char *memaddr;
|
||||||
int ret;
|
int ret;
|
||||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
#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 chip;
|
||||||
uint addr, length;
|
uint addr, length;
|
||||||
int alen;
|
uint alen;
|
||||||
int j, nbytes, linebytes;
|
uint j, nbytes, linebytes;
|
||||||
int ret;
|
int ret;
|
||||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
@ -589,9 +589,9 @@ static int do_i2c_mw(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
{
|
{
|
||||||
uint chip;
|
uint chip;
|
||||||
ulong addr;
|
ulong addr;
|
||||||
int alen;
|
uint alen;
|
||||||
uchar byte;
|
uchar byte;
|
||||||
int count;
|
uint count;
|
||||||
int ret;
|
int ret;
|
||||||
#if CONFIG_IS_ENABLED(DM_I2C)
|
#if CONFIG_IS_ENABLED(DM_I2C)
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
@ -676,8 +676,8 @@ static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
{
|
{
|
||||||
uint chip;
|
uint chip;
|
||||||
ulong addr;
|
ulong addr;
|
||||||
int alen;
|
uint alen;
|
||||||
int count;
|
uint count;
|
||||||
uchar byte;
|
uchar byte;
|
||||||
ulong crc;
|
ulong crc;
|
||||||
ulong err;
|
ulong err;
|
||||||
@ -985,7 +985,7 @@ static int do_i2c_loop(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
uint chip;
|
uint chip;
|
||||||
int alen;
|
uint alen;
|
||||||
uint addr;
|
uint addr;
|
||||||
uint length;
|
uint length;
|
||||||
u_char bytes[16];
|
u_char bytes[16];
|
||||||
|
@ -30,8 +30,10 @@ CONFIG_SPL_BOARD_INIT=y
|
|||||||
CONFIG_SPL_BOOTROM_SUPPORT=y
|
CONFIG_SPL_BOOTROM_SUPPORT=y
|
||||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
|
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
|
||||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
|
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
|
||||||
|
CONFIG_SPL_DMA=y
|
||||||
CONFIG_SPL_I2C=y
|
CONFIG_SPL_I2C=y
|
||||||
CONFIG_SPL_MTD_SUPPORT=y
|
CONFIG_SPL_MTD_SUPPORT=y
|
||||||
|
CONFIG_SPL_NAND_SUPPORT=y
|
||||||
CONFIG_SPL_POWER=y
|
CONFIG_SPL_POWER=y
|
||||||
CONFIG_SPL_WATCHDOG=y
|
CONFIG_SPL_WATCHDOG=y
|
||||||
CONFIG_SYS_PROMPT="> "
|
CONFIG_SYS_PROMPT="> "
|
||||||
@ -41,6 +43,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
|
|||||||
CONFIG_CMD_MTDPARTS=y
|
CONFIG_CMD_MTDPARTS=y
|
||||||
CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
|
CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
|
||||||
CONFIG_MTDPARTS_DEFAULT="gpmi-nand:64m(nandboot),16m(nandfit),32m(nandkernel),1m(nanddtb),8m(nandtee),-(nandrootfs)"
|
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_OF_CONTROL=y
|
||||||
CONFIG_SPL_OF_CONTROL=y
|
CONFIG_SPL_OF_CONTROL=y
|
||||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=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=y
|
||||||
CONFIG_NAND_MXS_DT=y
|
CONFIG_NAND_MXS_DT=y
|
||||||
CONFIG_SYS_NAND_ONFI_DETECTION=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_PHYLIB=y
|
||||||
CONFIG_PHY_NXP_TJA11XX=y
|
CONFIG_PHY_NXP_TJA11XX=y
|
||||||
CONFIG_DM_ETH=y
|
CONFIG_DM_ETH=y
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
#include <linux/compat.h>
|
||||||
#include <memalign.h>
|
#include <memalign.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -725,7 +726,8 @@ static int sqfs_read_inode_table(unsigned char **inode_table)
|
|||||||
goto free_itb;
|
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) {
|
if (!*inode_table) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
printf("Error: failed to allocate squashfs inode_table of size %i, increasing CONFIG_SYS_MALLOC_LEN could help\n",
|
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 \
|
#define NANDARGS \
|
||||||
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
||||||
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||||
"nandargs=setenv bootargs console=${console} " \
|
"nandargs=setenv bootargs " \
|
||||||
"${optargs} " \
|
"${optargs} " \
|
||||||
|
"mtdparts=${mtdparts} " \
|
||||||
"root=${nandroot} " \
|
"root=${nandroot} " \
|
||||||
"rootfstype=${nandrootfstype}\0" \
|
"rootfstype=${nandrootfstype}\0" \
|
||||||
"nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
|
"nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user