summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-04-06 12:16:57 -0600
committerTom Rini <[email protected]>2026-04-06 12:16:57 -0600
commit93f84ee022a8401421cdaab84fe7d106d83fdb4a (patch)
treefb15a4af876e8faf9893fd86c1c0e127265dbe9a /drivers/misc
parent88dc2788777babfd6322fa655df549a019aa1e69 (diff)
parente2138cf1e6088f12ffa874e87cc8f4b198378635 (diff)
Merge branch 'next'
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Kconfig6
-rw-r--r--drivers/misc/Makefile2
-rw-r--r--drivers/misc/atsha204a-i2c.c3
-rw-r--r--drivers/misc/fs_loader.c3
-rw-r--r--drivers/misc/gpio_led.c52
-rw-r--r--drivers/misc/imx8/fuse.c3
-rw-r--r--drivers/misc/imx8/scu_api.c25
-rw-r--r--drivers/misc/imx_ele/Makefile3
-rw-r--r--drivers/misc/imx_ele/ele_api.c28
-rw-r--r--drivers/misc/k3_fuse.c23
-rw-r--r--drivers/misc/rockchip-otp.c4
-rw-r--r--drivers/misc/status_led.c124
12 files changed, 77 insertions, 199 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index a0aa290480e..ea785793d18 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -86,6 +86,7 @@ config GATEWORKS_SC
config QCOM_GENI
bool "Qualcomm Generic Interface (GENI) driver"
depends on MISC
+ select EFI_PARTITION
select PARTITION_TYPE_GUID
help
Enable support for Qualcomm GENI and it's peripherals. GENI is responseible
@@ -256,7 +257,7 @@ config VPL_CROS_EC_LPC
config CROS_EC_SANDBOX
bool "Enable Chrome OS EC sandbox driver"
- depends on CROS_EC && SANDBOX
+ depends on CROS_EC && SANDBOX && HASH
help
Enable a sandbox emulation of the Chrome OS EC. This supports
keyboard (use the -l flag to enable the LCD), verified boot context,
@@ -350,7 +351,8 @@ config MXS_OCOTP
config NPCM_HOST
bool "Enable support espi or LPC for Host"
- depends on REGMAP && SYSCON
+ depends on SYSCON
+ select REGMAP
help
Enable NPCM BMC espi or LPC support for Host reading and writing.
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 1d950f7a0ab..e2170212e5a 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -48,8 +48,6 @@ obj-$(CONFIG_IHS_FPGA) += ihs_fpga.o
obj-$(CONFIG_IMX8) += imx8/
obj-$(CONFIG_IMX_ELE) += imx_ele/
obj-$(CONFIG_K3_FUSE) += k3_fuse.o
-obj-$(CONFIG_LED_STATUS) += status_led.o
-obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o
obj-$(CONFIG_$(PHASE_)LS2_SFP) += ls2_sfp.o
obj-$(CONFIG_$(PHASE_)MXC_OCOTP) += mxc_ocotp.o
diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c
index 3b9046da880..aa3094fcc01 100644
--- a/drivers/misc/atsha204a-i2c.c
+++ b/drivers/misc/atsha204a-i2c.c
@@ -15,7 +15,6 @@
#include <errno.h>
#include <atsha204a-i2c.h>
#include <log.h>
-#include <asm/global_data.h>
#include <linux/delay.h>
#include <linux/bitrev.h>
#include <u-boot/crc.h>
@@ -25,8 +24,6 @@
#define ATSHA204A_TRANSACTION_RETRY 5
#define ATSHA204A_EXECTIME 5000
-DECLARE_GLOBAL_DATA_PTR;
-
static inline u16 atsha204a_crc16(const u8 *buffer, size_t len)
{
return bitrev16(crc16(0, buffer, len));
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c
index 2928cf75f89..6af4c7f15e7 100644
--- a/drivers/misc/fs_loader.c
+++ b/drivers/misc/fs_loader.c
@@ -13,7 +13,6 @@
#include <fs.h>
#include <fs_loader.h>
#include <log.h>
-#include <asm/global_data.h>
#include <dm/device-internal.h>
#include <dm/root.h>
#include <linux/string.h>
@@ -25,8 +24,6 @@
#include <ubi_uboot.h>
#endif
-DECLARE_GLOBAL_DATA_PTR;
-
/**
* struct firmware - A place for storing firmware and its attribute data.
*
diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
deleted file mode 100644
index 1e2f83cca93..00000000000
--- a/drivers/misc/gpio_led.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Status LED driver based on GPIO access conventions of Linux
- *
- * Copyright (C) 2010 Thomas Chou <[email protected]>
- * Licensed under the GPL-2 or later.
- */
-
-#include <status_led.h>
-#include <asm/gpio.h>
-
-#ifndef CFG_GPIO_LED_INVERTED_TABLE
-#define CFG_GPIO_LED_INVERTED_TABLE {}
-#endif
-
-static led_id_t gpio_led_inv[] = CFG_GPIO_LED_INVERTED_TABLE;
-
-static int gpio_led_gpio_value(led_id_t mask, int state)
-{
- int i, gpio_value = (state == CONFIG_LED_STATUS_ON);
-
- for (i = 0; i < ARRAY_SIZE(gpio_led_inv); i++) {
- if (gpio_led_inv[i] == mask)
- gpio_value = !gpio_value;
- }
-
- return gpio_value;
-}
-
-void __led_init(led_id_t mask, int state)
-{
- int gpio_value;
-
- if (gpio_request(mask, "gpio_led") != 0) {
- printf("%s: failed requesting GPIO%lu!\n", __func__, mask);
- return;
- }
-
- gpio_value = gpio_led_gpio_value(mask, state);
- gpio_direction_output(mask, gpio_value);
-}
-
-void __led_set(led_id_t mask, int state)
-{
- int gpio_value = gpio_led_gpio_value(mask, state);
-
- gpio_set_value(mask, gpio_value);
-}
-
-void __led_toggle(led_id_t mask)
-{
- gpio_set_value(mask, !gpio_get_value(mask));
-}
diff --git a/drivers/misc/imx8/fuse.c b/drivers/misc/imx8/fuse.c
index 90d251a4405..872713e30b6 100644
--- a/drivers/misc/imx8/fuse.c
+++ b/drivers/misc/imx8/fuse.c
@@ -8,11 +8,8 @@
#include <fuse.h>
#include <firmware/imx/sci/sci.h>
#include <asm/arch/sys_proto.h>
-#include <asm/global_data.h>
#include <linux/arm-smccc.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#define FSL_ECC_WORD_START_1 0x10
#define FSL_ECC_WORD_END_1 0x10F
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c
index d9cc7acb970..c15a4a629ad 100644
--- a/drivers/misc/imx8/scu_api.c
+++ b/drivers/misc/imx8/scu_api.c
@@ -374,6 +374,31 @@ void sc_misc_boot_status(sc_ipc_t ipc, sc_misc_boot_status_t status)
__func__, status, RPC_R8(&msg));
}
+int sc_misc_get_boot_type(sc_ipc_t ipc, sc_misc_bt_t *type)
+{
+ struct udevice *dev = gd->arch.scu_dev;
+ int size = sizeof(struct sc_rpc_msg_s);
+ struct sc_rpc_msg_s msg;
+ int ret;
+
+ if (!dev)
+ hang();
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SIZE(&msg) = 1U;
+ RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC;
+ RPC_FUNC(&msg) = (u8)MISC_FUNC_GET_BOOT_TYPE;
+
+ ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+ if (ret < 0)
+ return ret;
+
+ if (type)
+ *type = (u8)RPC_U8(&msg, 0U);
+
+ return 0;
+}
+
int sc_misc_get_boot_container(sc_ipc_t ipc, u8 *idx)
{
struct udevice *dev = gd->arch.scu_dev;
diff --git a/drivers/misc/imx_ele/Makefile b/drivers/misc/imx_ele/Makefile
index f8d8c55f983..a5317454583 100644
--- a/drivers/misc/imx_ele/Makefile
+++ b/drivers/misc/imx_ele/Makefile
@@ -1,4 +1,3 @@
# SPDX-License-Identifier: GPL-2.0+
-obj-y += ele_api.o ele_mu.o
-obj-$(CONFIG_CMD_FUSE) += fuse.o
+obj-y += ele_api.o ele_mu.o fuse.o
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c
index e7aee0fcef1..8ee0a7733ca 100644
--- a/drivers/misc/imx_ele/ele_api.c
+++ b/drivers/misc/imx_ele/ele_api.c
@@ -844,3 +844,31 @@ int ele_volt_change_finish_req(void)
return ret;
}
+
+int ele_set_gmid(u32 *response)
+{
+ struct udevice *dev = gd->arch.ele_dev;
+ int size = sizeof(struct ele_msg);
+ struct ele_msg msg = {};
+ int ret;
+
+ if (!dev) {
+ printf("ele dev is not initialized\n");
+ return -ENODEV;
+ }
+
+ msg.version = ELE_VERSION;
+ msg.tag = ELE_CMD_TAG;
+ msg.size = 1;
+ msg.command = ELE_SET_GMID_REQ;
+
+ ret = misc_call(dev, false, &msg, size, &msg, size);
+ if (ret)
+ printf("Error: %s: ret %d, response 0x%x\n",
+ __func__, ret, msg.data[0]);
+
+ if (response)
+ *response = msg.data[0];
+
+ return ret;
+}
diff --git a/drivers/misc/k3_fuse.c b/drivers/misc/k3_fuse.c
index 4a8ff1f2523..faafaffe07e 100644
--- a/drivers/misc/k3_fuse.c
+++ b/drivers/misc/k3_fuse.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <fuse.h>
#include <linux/arm-smccc.h>
+#include <linux/bitops.h>
#include <string.h>
#define K3_SIP_OTP_WRITEBUFF 0xC2000000
@@ -28,20 +29,19 @@ int fuse_read(u32 bank, u32 word, u32 *val)
*val = res.a1;
if (res.a0 != 0)
- printf("SMC call failed: Error code %lu\n", res.a0);
+ printf("SMC call failed: Error code %ld\n", res.a0);
return res.a0;
}
int fuse_sense(u32 bank, u32 word, u32 *val)
{
- return -EPERM;
+ return fuse_read(bank, word, val);
}
int fuse_prog(u32 bank, u32 word, u32 val)
{
struct arm_smccc_res res;
- u32 mask = val;
if (bank != 0U) {
printf("Invalid bank argument, ONLY bank 0 is supported\n");
@@ -49,11 +49,18 @@ int fuse_prog(u32 bank, u32 word, u32 val)
}
/* Make SiP SMC call and send the word, val and mask in the parameter register */
- arm_smccc_smc(K3_SIP_OTP_WRITE, word,
- val, mask, 0, 0, 0, 0, &res);
+ arm_smccc_smc(K3_SIP_OTP_WRITE, bank, word,
+ val, GENMASK(25, 0), 0, 0, 0, &res);
- if (res.a0 != 0)
- printf("SMC call failed: Error code %lu\n", res.a0);
+ if (res.a0 != 0) {
+ printf("SMC call failed: Error code %ld\n", res.a0);
+ return res.a0;
+ }
+
+ if (res.a1 != val) {
+ printf("Readback failed, written 0x%x readback 0x%lx\n", val, res.a1);
+ return -EINVAL;
+ }
return res.a0;
}
@@ -72,7 +79,7 @@ int fuse_writebuff(ulong addr)
0, 0, 0, 0, 0, 0, &res);
if (res.a0 != 0)
- printf("SMC call failed: Error code %lu\n", res.a0);
+ printf("SMC call failed: Error code %ld\n", res.a0);
return res.a0;
}
diff --git a/drivers/misc/rockchip-otp.c b/drivers/misc/rockchip-otp.c
index 46820425a84..64b6238981b 100644
--- a/drivers/misc/rockchip-otp.c
+++ b/drivers/misc/rockchip-otp.c
@@ -391,6 +391,10 @@ static const struct udevice_id rockchip_otp_ids[] = {
.data = (ulong)&px30_data,
},
{
+ .compatible = "rockchip,rk3506-otp",
+ .data = (ulong)&rk3568_data,
+ },
+ {
.compatible = "rockchip,rk3528-otp",
.data = (ulong)&rk3568_data,
},
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
deleted file mode 100644
index 3b1baa4f840..00000000000
--- a/drivers/misc/status_led.c
+++ /dev/null
@@ -1,124 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2000-2003
- * Wolfgang Denk, DENX Software Engineering, [email protected].
- */
-
-#include <status_led.h>
-#include <linux/types.h>
-
-/*
- * The purpose of this code is to signal the operational status of a
- * target which usually boots over the network; while running in
- * U-Boot, a status LED is blinking. As soon as a valid BOOTP reply
- * message has been received, the LED is turned off. The Linux
- * kernel, once it is running, will start blinking the LED again,
- * with another frequency.
- */
-
-/* ------------------------------------------------------------------------- */
-
-typedef struct {
- led_id_t mask;
- int state;
- int period;
- int cnt;
-} led_dev_t;
-
-led_dev_t led_dev[] = {
- { CONFIG_LED_STATUS_BIT,
- CONFIG_LED_STATUS_STATE,
- LED_STATUS_PERIOD,
- 0,
- },
-#if defined(CONFIG_LED_STATUS1)
- { CONFIG_LED_STATUS_BIT1,
- CONFIG_LED_STATUS_STATE1,
- LED_STATUS_PERIOD1,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS2)
- { CONFIG_LED_STATUS_BIT2,
- CONFIG_LED_STATUS_STATE2,
- LED_STATUS_PERIOD2,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS3)
- { CONFIG_LED_STATUS_BIT3,
- CONFIG_LED_STATUS_STATE3,
- LED_STATUS_PERIOD3,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS4)
- { CONFIG_LED_STATUS_BIT4,
- CONFIG_LED_STATUS_STATE4,
- LED_STATUS_PERIOD4,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS5)
- { CONFIG_LED_STATUS_BIT5,
- CONFIG_LED_STATUS_STATE5,
- LED_STATUS_PERIOD5,
- 0,
- },
-#endif
-};
-
-#define MAX_LED_DEV (sizeof(led_dev)/sizeof(led_dev_t))
-
-static int status_led_init_done = 0;
-
-void status_led_init(void)
-{
- led_dev_t *ld;
- int i;
-
- for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++)
- __led_init (ld->mask, ld->state);
- status_led_init_done = 1;
-}
-
-void status_led_tick(ulong timestamp)
-{
- led_dev_t *ld;
- int i;
-
- if (!status_led_init_done)
- status_led_init();
-
- for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) {
-
- if (ld->state != CONFIG_LED_STATUS_BLINKING)
- continue;
-
- if (++ld->cnt >= ld->period) {
- __led_toggle (ld->mask);
- ld->cnt -= ld->period;
- }
-
- }
-}
-
-void status_led_set(int led, int state)
-{
- led_dev_t *ld;
-
- if (led < 0 || led >= MAX_LED_DEV)
- return;
-
- if (!status_led_init_done)
- status_led_init();
-
- ld = &led_dev[led];
-
- ld->state = state;
- if (state == CONFIG_LED_STATUS_BLINKING) {
- ld->cnt = 0; /* always start with full period */
- state = CONFIG_LED_STATUS_ON; /* always start with LED _ON_ */
- }
- __led_set (ld->mask, state);
-}