Merge branch '2022-10-12-additional-fixes'
- Add "ubi list", Nokia RX51 fixes, other assorted fixes
This commit is contained in:
commit
0e49f5c26c
@ -561,7 +561,7 @@ static const char keymap[] = {
|
||||
'q', 'o', 'p', ',', '\b', 0, 'a', 's',
|
||||
'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
|
||||
'e', '.', 0, '\r', 0, 'z', 'x', 'c',
|
||||
'r', 'v', 'b', 'n', 'm', ' ', ' ', 0,
|
||||
'r', 'v', 'b', 'n', 'm', ' ', 0, 0,
|
||||
't', 0, 0, 0, 0, 0, 0, 0,
|
||||
'y', 0, 0, 0, 0, 0, 0, 0,
|
||||
'u', 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -691,6 +691,10 @@ static int rx51_kp_tstc(struct udevice *dev)
|
||||
mods = keys[4] >> 4;
|
||||
keys[4] &= 0x0f;
|
||||
|
||||
/* space key is indicated by two different bits */
|
||||
keys[3] |= (keys[3] & (1 << 6)) >> 1;
|
||||
keys[3] &= ~(1 << 6);
|
||||
|
||||
for (c = 0; c < 8; c++) {
|
||||
|
||||
/* get newly pressed keys only */
|
||||
|
85
cmd/ubi.c
85
cmd/ubi.c
@ -27,6 +27,7 @@
|
||||
#include <ubi_uboot.h>
|
||||
#include <linux/errno.h>
|
||||
#include <jffs2/load_kernel.h>
|
||||
#include <linux/log2.h>
|
||||
|
||||
#undef ubi_msg
|
||||
#define ubi_msg(fmt, ...) printf("UBI: " fmt "\n", ##__VA_ARGS__)
|
||||
@ -84,6 +85,70 @@ static int ubi_info(int layout)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ubi_list(const char *var, int numeric)
|
||||
{
|
||||
size_t namelen, len, size;
|
||||
char *str, *str2;
|
||||
int i;
|
||||
|
||||
if (!var) {
|
||||
for (i = 0; i < (ubi->vtbl_slots + 1); i++) {
|
||||
if (!ubi->volumes[i])
|
||||
continue;
|
||||
if (ubi->volumes[i]->vol_id >= UBI_INTERNAL_VOL_START)
|
||||
continue;
|
||||
printf("%d: %s\n",
|
||||
ubi->volumes[i]->vol_id,
|
||||
ubi->volumes[i]->name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = 0;
|
||||
size = 16;
|
||||
str = malloc(size);
|
||||
if (!str)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < (ubi->vtbl_slots + 1); i++) {
|
||||
if (!ubi->volumes[i])
|
||||
continue;
|
||||
if (ubi->volumes[i]->vol_id >= UBI_INTERNAL_VOL_START)
|
||||
continue;
|
||||
|
||||
if (numeric)
|
||||
namelen = 10; /* strlen(stringify(INT_MAX)) */
|
||||
else
|
||||
namelen = strlen(ubi->volumes[i]->name);
|
||||
|
||||
if (len + namelen + 1 > size) {
|
||||
size = roundup_pow_of_two(len + namelen + 1) * 2;
|
||||
str2 = realloc(str, size);
|
||||
if (!str2) {
|
||||
free(str);
|
||||
return 1;
|
||||
}
|
||||
str = str2;
|
||||
}
|
||||
|
||||
if (len)
|
||||
str[len++] = ' ';
|
||||
|
||||
if (numeric) {
|
||||
len += sprintf(str + len, "%d", ubi->volumes[i]->vol_id) + 1;
|
||||
} else {
|
||||
memcpy(str + len, ubi->volumes[i]->name, namelen);
|
||||
len += namelen;
|
||||
str[len] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
env_set(var, str);
|
||||
free(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ubi_check_volumename(const struct ubi_volume *vol, char *name)
|
||||
{
|
||||
return strcmp(vol->name, name);
|
||||
@ -586,6 +651,21 @@ static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
return ubi_info(layout);
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "list") == 0) {
|
||||
int numeric = 0;
|
||||
if (argc >= 2 && argv[2][0] == '-') {
|
||||
if (strcmp(argv[2], "-numeric") == 0)
|
||||
numeric = 1;
|
||||
else
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
if (!numeric && argc != 2 && argc != 3)
|
||||
return CMD_RET_USAGE;
|
||||
if (numeric && argc != 3 && argc != 4)
|
||||
return CMD_RET_USAGE;
|
||||
return ubi_list(argv[numeric ? 3 : 2], numeric);
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "check") == 0) {
|
||||
if (argc > 2)
|
||||
return ubi_check(argv[2]);
|
||||
@ -725,6 +805,11 @@ U_BOOT_CMD(
|
||||
" header offset)\n"
|
||||
"ubi info [l[ayout]]"
|
||||
" - Display volume and ubi layout information\n"
|
||||
"ubi list [flags]"
|
||||
" - print the list of volumes\n"
|
||||
"ubi list [flags] <varname>"
|
||||
" - set environment variable to the list of volumes"
|
||||
" (flags can be -numeric)\n"
|
||||
"ubi check volumename"
|
||||
" - check if volumename exists\n"
|
||||
"ubi create[vol] volume [size] [type] [id] [--skipcheck]\n"
|
||||
|
@ -96,7 +96,7 @@ static int setup_channel(struct udevice *dev, struct scmi_mbox_channel *chan)
|
||||
static int scmi_mbox_get_channel(struct udevice *dev,
|
||||
struct scmi_channel **channel)
|
||||
{
|
||||
struct scmi_mbox_channel *base_chan = dev_get_plat(dev->parent);
|
||||
struct scmi_mbox_channel *base_chan = dev_get_plat(dev);
|
||||
struct scmi_mbox_channel *chan;
|
||||
int ret;
|
||||
|
||||
|
@ -326,7 +326,7 @@ static int setup_channel(struct udevice *dev, struct scmi_optee_channel *chan)
|
||||
static int scmi_optee_get_channel(struct udevice *dev,
|
||||
struct scmi_channel **channel)
|
||||
{
|
||||
struct scmi_optee_channel *base_chan = dev_get_plat(dev->parent);
|
||||
struct scmi_optee_channel *base_chan = dev_get_plat(dev);
|
||||
struct scmi_optee_channel *chan;
|
||||
u32 channel_id;
|
||||
int ret;
|
||||
|
@ -137,7 +137,7 @@ int devm_scmi_of_get_channel(struct udevice *dev, struct scmi_channel **channel)
|
||||
return -ENODEV;
|
||||
|
||||
if (transport_dev_ops(parent)->of_get_channel)
|
||||
return transport_dev_ops(parent)->of_get_channel(dev, channel);
|
||||
return transport_dev_ops(parent)->of_get_channel(parent, channel);
|
||||
|
||||
/* Drivers without a get_channel operator don't need a channel ref */
|
||||
*channel = NULL;
|
||||
|
@ -83,7 +83,7 @@ static int setup_channel(struct udevice *dev, struct scmi_smccc_channel *chan)
|
||||
static int scmi_smccc_get_channel(struct udevice *dev,
|
||||
struct scmi_channel **channel)
|
||||
{
|
||||
struct scmi_smccc_channel *base_chan = dev_get_plat(dev->parent);
|
||||
struct scmi_smccc_channel *base_chan = dev_get_plat(dev);
|
||||
struct scmi_smccc_channel *chan;
|
||||
u32 func_id;
|
||||
int ret;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <smem.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
@ -241,7 +241,7 @@ config USB_ETH_RNDIS
|
||||
|
||||
endchoice
|
||||
|
||||
config USBNET_DEVADDR
|
||||
config USBNET_DEV_ADDR
|
||||
string "USB Gadget Ethernet device mac address"
|
||||
default "de:ad:be:ef:00:01"
|
||||
help
|
||||
|
@ -2620,7 +2620,7 @@ static int usb_eth_probe(struct udevice *dev)
|
||||
priv->netdev = dev;
|
||||
l_priv = priv;
|
||||
|
||||
get_ether_addr(CONFIG_USBNET_DEVADDR, pdata->enetaddr);
|
||||
get_ether_addr(CONFIG_USBNET_DEV_ADDR, pdata->enetaddr);
|
||||
eth_env_set_enetaddr("usbnet_devaddr", pdata->enetaddr);
|
||||
|
||||
return 0;
|
||||
|
@ -31,8 +31,6 @@
|
||||
#define V_OSCK 26000000 /* Clock output from T2 */
|
||||
#define V_SCLK (V_OSCK >> 1)
|
||||
|
||||
#define CONFIG_UBI_SIZE (512 << 10)
|
||||
|
||||
/*
|
||||
* Hardware drivers
|
||||
*/
|
||||
|
@ -100,8 +100,6 @@
|
||||
/* USB Device Firmware Update support */
|
||||
#define DFU_DEFAULT_POLL_TIMEOUT 300
|
||||
|
||||
#define CONFIG_USBNET_DEV_ADDR "de:ad:be:af:00:01"
|
||||
|
||||
/* Environment variable name to represent HAB enable state */
|
||||
#define HAB_ENABLED_ENVNAME "hab_enabled"
|
||||
|
||||
|
@ -15,5 +15,7 @@ obj-$(CONFIG_CMD_LOADM) += loadm.o
|
||||
obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o
|
||||
obj-$(CONFIG_CMD_PINMUX) += pinmux.o
|
||||
obj-$(CONFIG_CMD_PWM) += pwm.o
|
||||
ifdef CONFIG_SANDBOX
|
||||
obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
|
||||
endif
|
||||
obj-$(CONFIG_CMD_TEMPERATURE) += temperature.o
|
||||
|
@ -62,7 +62,7 @@ static struct cmd_tbl cmd_ut_sub[] = {
|
||||
U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
|
||||
#endif
|
||||
U_BOOT_CMD_MKENT(mem, CONFIG_SYS_MAXARGS, 1, do_ut_mem, "", ""),
|
||||
#ifdef CONFIG_CMD_SETEXPR
|
||||
#if defined(CONFIG_SANDBOX) && defined(CONFIG_CMD_SETEXPR)
|
||||
U_BOOT_CMD_MKENT(setexpr, CONFIG_SYS_MAXARGS, 1, do_ut_setexpr, "",
|
||||
""),
|
||||
#endif
|
||||
|
@ -238,7 +238,7 @@ gen_cert() {
|
||||
#echo " IMAGE_SIZE = $BIN_SIZE"
|
||||
#echo " CERT_TYPE = $CERTTYPE"
|
||||
#echo " DEBUG_TYPE = $DEBUG_TYPE"
|
||||
echo " SWRV = $SWRV"
|
||||
#echo " SWRV = $SWRV"
|
||||
sed -e "s/TEST_IMAGE_LENGTH/$BIN_SIZE/" \
|
||||
-e "s/TEST_IMAGE_SHA_VAL/$SHA_VAL/" \
|
||||
-e "s/TEST_CERT_TYPE/$CERTTYPE/" \
|
||||
|
Loading…
Reference in New Issue
Block a user