Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
7e58a3a1
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e58a3a1
编写于
7月 07, 2021
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge tag 'dm-pull-6jul21' of
https://source.denx.de/u-boot/custodians/u-boot-dm
various minor sandbox improvements
上级
5b8a8355
880e4768
变更
95
隐藏空白更改
内联
并排
Showing
95 changed file
with
348 addition
and
24 deletion
+348
-24
arch/sandbox/cpu/start.c
arch/sandbox/cpu/start.c
+23
-10
arch/sandbox/dts/test.dts
arch/sandbox/dts/test.dts
+6
-0
arch/sandbox/include/asm/state.h
arch/sandbox/include/asm/state.h
+1
-0
arch/sandbox/include/asm/test.h
arch/sandbox/include/asm/test.h
+10
-0
common/board_f.c
common/board_f.c
+3
-1
configs/sandbox64_defconfig
configs/sandbox64_defconfig
+1
-0
configs/sandbox_defconfig
configs/sandbox_defconfig
+1
-0
configs/sandbox_flattree_defconfig
configs/sandbox_flattree_defconfig
+1
-0
configs/sandbox_noinst_defconfig
configs/sandbox_noinst_defconfig
+1
-0
configs/sandbox_spl_defconfig
configs/sandbox_spl_defconfig
+1
-0
drivers/adc/adc-uclass.c
drivers/adc/adc-uclass.c
+2
-0
drivers/ata/ahci-uclass.c
drivers/ata/ahci-uclass.c
+2
-0
drivers/axi/axi-emul-uclass.c
drivers/axi/axi-emul-uclass.c
+2
-0
drivers/axi/axi-uclass.c
drivers/axi/axi-uclass.c
+2
-0
drivers/block/blk-uclass.c
drivers/block/blk-uclass.c
+2
-0
drivers/block/ide.c
drivers/block/ide.c
+2
-0
drivers/bootcount/bootcount-uclass.c
drivers/bootcount/bootcount-uclass.c
+2
-0
drivers/button/button-uclass.c
drivers/button/button-uclass.c
+2
-0
drivers/cache/cache-uclass.c
drivers/cache/cache-uclass.c
+2
-0
drivers/clk/clk-uclass.c
drivers/clk/clk-uclass.c
+2
-0
drivers/core/root.c
drivers/core/root.c
+2
-3
drivers/core/simple-bus.c
drivers/core/simple-bus.c
+2
-0
drivers/cpu/cpu-uclass.c
drivers/cpu/cpu-uclass.c
+2
-0
drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
+2
-0
drivers/dma/dma-uclass.c
drivers/dma/dma-uclass.c
+2
-0
drivers/firmware/firmware-uclass.c
drivers/firmware/firmware-uclass.c
+2
-0
drivers/hwspinlock/hwspinlock-uclass.c
drivers/hwspinlock/hwspinlock-uclass.c
+2
-0
drivers/i2c/i2c-emul-uclass.c
drivers/i2c/i2c-emul-uclass.c
+2
-0
drivers/i2c/i2c-uclass.c
drivers/i2c/i2c-uclass.c
+2
-0
drivers/i2c/muxes/i2c-mux-uclass.c
drivers/i2c/muxes/i2c-mux-uclass.c
+2
-0
drivers/input/keyboard-uclass.c
drivers/input/keyboard-uclass.c
+2
-0
drivers/led/led-uclass.c
drivers/led/led-uclass.c
+2
-0
drivers/mailbox/mailbox-uclass.c
drivers/mailbox/mailbox-uclass.c
+2
-0
drivers/misc/cros_ec_sandbox.c
drivers/misc/cros_ec_sandbox.c
+47
-0
drivers/misc/fs_loader.c
drivers/misc/fs_loader.c
+3
-0
drivers/misc/i2c_eeprom.c
drivers/misc/i2c_eeprom.c
+2
-0
drivers/misc/misc-uclass.c
drivers/misc/misc-uclass.c
+2
-0
drivers/misc/p2sb-uclass.c
drivers/misc/p2sb-uclass.c
+2
-0
drivers/misc/pwrseq-uclass.c
drivers/misc/pwrseq-uclass.c
+2
-0
drivers/mmc/mmc-uclass.c
drivers/mmc/mmc-uclass.c
+2
-0
drivers/mtd/mtd-uclass.c
drivers/mtd/mtd-uclass.c
+2
-0
drivers/mtd/spi/sf-uclass.c
drivers/mtd/spi/sf-uclass.c
+2
-0
drivers/mux/mux-uclass.c
drivers/mux/mux-uclass.c
+2
-0
drivers/nvme/nvme-uclass.c
drivers/nvme/nvme-uclass.c
+2
-0
drivers/pch/pch-uclass.c
drivers/pch/pch-uclass.c
+2
-0
drivers/pci/pci-uclass.c
drivers/pci/pci-uclass.c
+2
-0
drivers/pci_endpoint/pci_ep-uclass.c
drivers/pci_endpoint/pci_ep-uclass.c
+2
-0
drivers/phy/phy-uclass.c
drivers/phy/phy-uclass.c
+2
-0
drivers/pinctrl/pinctrl-uclass.c
drivers/pinctrl/pinctrl-uclass.c
+2
-0
drivers/power/domain/power-domain-uclass.c
drivers/power/domain/power-domain-uclass.c
+2
-0
drivers/power/pmic/pmic-uclass.c
drivers/power/pmic/pmic-uclass.c
+2
-0
drivers/power/regulator/regulator-uclass.c
drivers/power/regulator/regulator-uclass.c
+2
-0
drivers/pwm/pwm-uclass.c
drivers/pwm/pwm-uclass.c
+2
-0
drivers/ram/ram-uclass.c
drivers/ram/ram-uclass.c
+2
-0
drivers/remoteproc/rproc-uclass.c
drivers/remoteproc/rproc-uclass.c
+3
-0
drivers/reset/reset-uclass.c
drivers/reset/reset-uclass.c
+2
-0
drivers/rng/rng-uclass.c
drivers/rng/rng-uclass.c
+2
-0
drivers/rtc/rtc-uclass.c
drivers/rtc/rtc-uclass.c
+2
-0
drivers/scsi/scsi-uclass.c
drivers/scsi/scsi-uclass.c
+2
-0
drivers/serial/serial-uclass.c
drivers/serial/serial-uclass.c
+2
-0
drivers/smem/smem-uclass.c
drivers/smem/smem-uclass.c
+2
-0
drivers/soc/soc-uclass.c
drivers/soc/soc-uclass.c
+2
-0
drivers/sound/codec-uclass.c
drivers/sound/codec-uclass.c
+2
-0
drivers/sound/i2s-uclass.c
drivers/sound/i2s-uclass.c
+2
-0
drivers/sound/sound-uclass.c
drivers/sound/sound-uclass.c
+2
-0
drivers/spi/spi-emul-uclass.c
drivers/spi/spi-emul-uclass.c
+2
-0
drivers/spmi/spmi-uclass.c
drivers/spmi/spmi-uclass.c
+2
-0
drivers/sysinfo/sysinfo-uclass.c
drivers/sysinfo/sysinfo-uclass.c
+2
-0
drivers/tee/tee-uclass.c
drivers/tee/tee-uclass.c
+2
-0
drivers/thermal/thermal-uclass.c
drivers/thermal/thermal-uclass.c
+2
-0
drivers/timer/timer-uclass.c
drivers/timer/timer-uclass.c
+2
-0
drivers/ufs/ufs-uclass.c
drivers/ufs/ufs-uclass.c
+2
-0
drivers/usb/emul/usb-emul-uclass.c
drivers/usb/emul/usb-emul-uclass.c
+2
-0
drivers/usb/gadget/udc/udc-uclass.c
drivers/usb/gadget/udc/udc-uclass.c
+2
-0
drivers/usb/host/usb-uclass.c
drivers/usb/host/usb-uclass.c
+2
-0
drivers/video/backlight-uclass.c
drivers/video/backlight-uclass.c
+2
-0
drivers/video/bridge/video-bridge-uclass.c
drivers/video/bridge/video-bridge-uclass.c
+2
-0
drivers/video/display-uclass.c
drivers/video/display-uclass.c
+2
-0
drivers/video/dsi-host-uclass.c
drivers/video/dsi-host-uclass.c
+2
-0
drivers/video/panel-uclass.c
drivers/video/panel-uclass.c
+2
-0
drivers/video/vidconsole-uclass.c
drivers/video/vidconsole-uclass.c
+2
-0
drivers/video/video-uclass.c
drivers/video/video-uclass.c
+2
-0
drivers/video/video_osd-uclass.c
drivers/video/video_osd-uclass.c
+2
-0
drivers/virtio/virtio-uclass.c
drivers/virtio/virtio-uclass.c
+2
-0
drivers/w1-eeprom/w1-eeprom-uclass.c
drivers/w1-eeprom/w1-eeprom-uclass.c
+2
-0
drivers/w1/w1-uclass.c
drivers/w1/w1-uclass.c
+2
-0
drivers/watchdog/wdt-uclass.c
drivers/watchdog/wdt-uclass.c
+2
-0
drivers/xen/pvblock.c
drivers/xen/pvblock.c
+3
-0
include/dm/uclass.h
include/dm/uclass.h
+0
-3
test/cmd/pwm.c
test/cmd/pwm.c
+30
-2
test/dm/Makefile
test/dm/Makefile
+1
-0
test/dm/cros_ec_pwm.c
test/dm/cros_ec_pwm.c
+60
-0
test/dm/panel.c
test/dm/panel.c
+1
-1
test/dm/pwm.c
test/dm/pwm.c
+4
-2
tools/patman/tools.py
tools/patman/tools.py
+0
-2
未找到文件。
arch/sandbox/cpu/start.c
浏览文件 @
7e58a3a1
...
...
@@ -390,6 +390,16 @@ static int sandbox_cmdline_cb_select_unittests(struct sandbox_state *state,
}
SANDBOX_CMDLINE_OPT_SHORT
(
select_unittests
,
'k'
,
1
,
"Select unit tests to run"
);
static
int
sandbox_cmdline_cb_signals
(
struct
sandbox_state
*
state
,
const
char
*
arg
)
{
state
->
handle_signals
=
true
;
return
0
;
}
SANDBOX_CMDLINE_OPT_SHORT
(
signals
,
'S'
,
0
,
"Handle signals (such as SIGSEGV) in sandbox"
);
static
void
setup_ram_buf
(
struct
sandbox_state
*
state
)
{
/* Zero the RAM buffer if we didn't read it, to keep valgrind happy */
...
...
@@ -426,9 +436,6 @@ void sandbox_reset(void)
if
(
state_uninit
())
os_exit
(
2
);
if
(
dm_uninit
())
os_exit
(
2
);
/* Restart U-Boot */
os_relaunch
(
os_argv
);
}
...
...
@@ -443,6 +450,14 @@ int main(int argc, char *argv[])
text_base
=
os_find_text_base
();
/*
* This must be the first invocation of os_malloc() to have
* state->ram_buf in the low 4 GiB.
*/
ret
=
state_init
();
if
(
ret
)
goto
err
;
/*
* Copy argv[] so that we can pass the arguments in the original
* sequence when resetting the sandbox.
...
...
@@ -457,10 +472,6 @@ int main(int argc, char *argv[])
gd
=
&
data
;
gd
->
arch
.
text_base
=
text_base
;
ret
=
state_init
();
if
(
ret
)
goto
err
;
state
=
state_get_current
();
if
(
os_parse_args
(
state
,
argc
,
argv
))
return
1
;
...
...
@@ -476,9 +487,11 @@ int main(int argc, char *argv[])
if
(
ret
)
goto
err
;
ret
=
os_setup_signal_handlers
();
if
(
ret
)
goto
err
;
if
(
state
->
handle_signals
)
{
ret
=
os_setup_signal_handlers
();
if
(
ret
)
goto
err
;
}
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
gd
->
malloc_base
=
CONFIG_MALLOC_F_ADDR
;
...
...
arch/sandbox/dts/test.dts
浏览文件 @
7e58a3a1
...
...
@@ -139,6 +139,12 @@
size
=
<
0x10000
>;
};
};
cros_ec_pwm
:
cros
-
ec
-
pwm
{
compatible
=
"google,cros-ec-pwm"
;
#
pwm
-
cells
=
<
1
>;
};
};
dsi_host
:
dsi_host
{
...
...
arch/sandbox/include/asm/state.h
浏览文件 @
7e58a3a1
...
...
@@ -93,6 +93,7 @@ struct sandbox_state {
bool
ram_buf_read
;
/* true if we read the RAM buffer */
bool
run_unittests
;
/* Run unit tests */
const
char
*
select_unittests
;
/* Unit test to run */
bool
handle_signals
;
/* Handle signals within sandbox */
/* Pointer to information for each SPI bus/cs */
struct
sandbox_spi_info
spi
[
CONFIG_SANDBOX_SPI_MAX_BUS
]
...
...
arch/sandbox/include/asm/test.h
浏览文件 @
7e58a3a1
...
...
@@ -275,4 +275,14 @@ void sandbox_set_enable_memio(bool enable);
*/
void
sandbox_cros_ec_set_test_flags
(
struct
udevice
*
dev
,
uint
flags
);
/**
* sandbox_cros_ec_get_pwm_duty() - Get EC PWM config for testing purposes
*
* @dev: Device to check
* @index: PWM channel index
* @duty: Current duty cycle in 0..EC_PWM_MAX_DUTY range.
* @return 0 if OK, -ENOSPC if the PWM number is invalid
*/
int
sandbox_cros_ec_get_pwm_duty
(
struct
udevice
*
dev
,
uint
index
,
uint
*
duty
);
#endif
common/board_f.c
浏览文件 @
7e58a3a1
...
...
@@ -265,7 +265,9 @@ static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
gd
->
mon_len
=
(
ulong
)
&
__bss_end
-
(
ulong
)
_start
;
#elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
#elif defined(CONFIG_SANDBOX)
gd
->
mon_len
=
0
;
#elif defined(CONFIG_EFI_APP)
gd
->
mon_len
=
(
ulong
)
&
_end
-
(
ulong
)
_init
;
#elif defined(CONFIG_NIOS2) || defined(CONFIG_XTENSA)
gd
->
mon_len
=
CONFIG_SYS_MONITOR_LEN
;
...
...
configs/sandbox64_defconfig
浏览文件 @
7e58a3a1
...
...
@@ -188,6 +188,7 @@ CONFIG_REGULATOR_S5M8767=y
CONFIG_DM_REGULATOR_SANDBOX=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_PWM=y
CONFIG_PWM_CROS_EC=y
CONFIG_PWM_SANDBOX=y
CONFIG_RAM=y
CONFIG_REMOTEPROC_SANDBOX=y
...
...
configs/sandbox_defconfig
浏览文件 @
7e58a3a1
...
...
@@ -226,6 +226,7 @@ CONFIG_DM_REGULATOR_SANDBOX=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_REGULATOR_SCMI=y
CONFIG_DM_PWM=y
CONFIG_PWM_CROS_EC=y
CONFIG_PWM_SANDBOX=y
CONFIG_RAM=y
CONFIG_REMOTEPROC_SANDBOX=y
...
...
configs/sandbox_flattree_defconfig
浏览文件 @
7e58a3a1
...
...
@@ -165,6 +165,7 @@ CONFIG_REGULATOR_S5M8767=y
CONFIG_DM_REGULATOR_SANDBOX=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_PWM=y
CONFIG_PWM_CROS_EC=y
CONFIG_PWM_SANDBOX=y
CONFIG_RAM=y
CONFIG_REMOTEPROC_SANDBOX=y
...
...
configs/sandbox_noinst_defconfig
浏览文件 @
7e58a3a1
...
...
@@ -181,6 +181,7 @@ CONFIG_REGULATOR_S5M8767=y
CONFIG_DM_REGULATOR_SANDBOX=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_PWM=y
CONFIG_PWM_CROS_EC=y
CONFIG_PWM_SANDBOX=y
CONFIG_RAM=y
CONFIG_REMOTEPROC_SANDBOX=y
...
...
configs/sandbox_spl_defconfig
浏览文件 @
7e58a3a1
...
...
@@ -183,6 +183,7 @@ CONFIG_REGULATOR_S5M8767=y
CONFIG_DM_REGULATOR_SANDBOX=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_PWM=y
CONFIG_PWM_CROS_EC=y
CONFIG_PWM_SANDBOX=y
CONFIG_RAM=y
CONFIG_REMOTEPROC_SANDBOX=y
...
...
drivers/adc/adc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Przemyslaw Marczak <p.marczak@samsung.com>
*/
#define LOG_CATEGORY UCLASS_ADC
#include <common.h>
#include <errno.h>
#include <div64.h>
...
...
drivers/ata/ahci-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_AHCI
#include <common.h>
#include <ahci.h>
#include <dm.h>
...
...
drivers/axi/axi-emul-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
*/
#define LOG_CATEGORY UCLASS_AXI_EMUL
#include <common.h>
#include <axi.h>
#include <dm.h>
...
...
drivers/axi/axi-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
*/
#define LOG_CATEGORY UCLASS_AXI
#include <common.h>
#include <dm.h>
#include <axi.h>
...
...
drivers/block/blk-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_BLK
#include <common.h>
#include <blk.h>
#include <dm.h>
...
...
drivers/block/ide.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
#define LOG_CATEGORY UCLASS_IDE
#include <common.h>
#include <ata.h>
#include <blk.h>
...
...
drivers/bootcount/bootcount-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* (C) Copyright 2018 Theobroma Systems Design und Consulting GmbH
*/
#define LOG_CATEGORY UCLASS_BOOTCOUNT
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/button/button-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -5,6 +5,8 @@
* Based on led-uclass.c
*/
#define LOG_CATEGORY UCLASS_BUTTON
#include <common.h>
#include <button.h>
#include <dm.h>
...
...
drivers/cache/cache-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2019 Intel Corporation <www.intel.com>
*/
#define LOG_CATEGORY UCLASS_CACHE
#include <common.h>
#include <cache.h>
#include <dm.h>
...
...
drivers/clk/clk-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -6,6 +6,8 @@
* Copyright (c) 2018, Theobroma Systems Design und Consulting GmbH
*/
#define LOG_CATEGORY UCLASS_CLK
#include <common.h>
#include <clk.h>
#include <clk-uclass.h>
...
...
drivers/core/root.c
浏览文件 @
7e58a3a1
...
...
@@ -6,6 +6,8 @@
* Pavel Herrmann <morpheus.ibis@gmail.com>
*/
#define LOG_CATEGORY UCLASS_ROOT
#include <common.h>
#include <errno.h>
#include <fdtdec.h>
...
...
@@ -111,9 +113,6 @@ void fix_uclass(void)
entry
->
init
+=
gd
->
reloc_off
;
if
(
entry
->
destroy
)
entry
->
destroy
+=
gd
->
reloc_off
;
/* FIXME maybe also need to fix these ops */
if
(
entry
->
ops
)
entry
->
ops
+=
gd
->
reloc_off
;
}
}
...
...
drivers/core/simple-bus.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_SIMPLE_BUS
#include <common.h>
#include <asm/global_data.h>
#include <dm.h>
...
...
drivers/cpu/cpu-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_CPU
#include <common.h>
#include <cpu.h>
#include <dm.h>
...
...
drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Author: Ruchika Gupta <ruchika.gupta@freescale.com>
*/
#define LOG_CATEGORY UCLASS_MOD_EXP
#include <common.h>
#include <dm.h>
#include <asm/global_data.h>
...
...
drivers/dma/dma-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -9,6 +9,8 @@
* Author: Mugunthan V N <mugunthanvnm@ti.com>
*/
#define LOG_CATEGORY UCLASS_DMA
#include <common.h>
#include <cpu_func.h>
#include <dm.h>
...
...
drivers/firmware/firmware-uclass.c
浏览文件 @
7e58a3a1
// SPDX-License-Identifier: GPL-2.0+
#define LOG_CATEGORY UCLASS_FIRMWARE
#include <common.h>
#include <dm.h>
...
...
drivers/hwspinlock/hwspinlock-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
*/
#define LOG_CATEGORY UCLASS_HWSPINLOCK
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/i2c/i2c-emul-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_I2C_EMUL
#include <common.h>
#include <dm.h>
#include <i2c.h>
...
...
drivers/i2c/i2c-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_I2C
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/i2c/muxes/i2c-mux-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_I2C_MUX
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/input/keyboard-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2015 Google, Inc
*/
#define LOG_CATEGORY UCLASS_KEYBOARD
#include <common.h>
#include <dm.h>
#include <keyboard.h>
...
...
drivers/led/led-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_LED
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/mailbox/mailbox-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2016, NVIDIA CORPORATION.
*/
#define LOG_CATEGORY UCLASS_MAILBOX
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/misc/cros_ec_sandbox.c
浏览文件 @
7e58a3a1
...
...
@@ -64,6 +64,7 @@ struct ec_keymatrix_entry {
enum
{
VSTORE_SLOT_COUNT
=
4
,
PWM_CHANNEL_COUNT
=
4
,
};
struct
vstore_slot
{
...
...
@@ -71,6 +72,10 @@ struct vstore_slot {
u8
data
[
EC_VSTORE_SLOT_SIZE
];
};
struct
ec_pwm_channel
{
uint
duty
;
/* not ns, EC_PWM_MAX_DUTY = 100% */
};
/**
* struct ec_state - Information about the EC state
*
...
...
@@ -85,6 +90,7 @@ struct vstore_slot {
* @recovery_req: Keyboard recovery requested
* @test_flags: Flags that control behaviour for tests
* @slot_locked: Locked vstore slots (mask)
* @pwm: Information per PWM channel
*/
struct
ec_state
{
u8
vbnv_context
[
EC_VBNV_BLOCK_SIZE_V2
];
...
...
@@ -98,6 +104,7 @@ struct ec_state {
bool
recovery_req
;
uint
test_flags
;
struct
vstore_slot
slot
[
VSTORE_SLOT_COUNT
];
struct
ec_pwm_channel
pwm
[
PWM_CHANNEL_COUNT
];
}
s_state
,
*
g_state
;
/**
...
...
@@ -554,6 +561,33 @@ static int process_cmd(struct ec_state *ec,
len
=
sizeof
(
*
resp
);
break
;
}
case
EC_CMD_PWM_GET_DUTY
:
{
const
struct
ec_params_pwm_get_duty
*
req
=
req_data
;
struct
ec_response_pwm_get_duty
*
resp
=
resp_data
;
struct
ec_pwm_channel
*
pwm
;
if
(
req
->
pwm_type
!=
EC_PWM_TYPE_GENERIC
)
return
-
EINVAL
;
if
(
req
->
index
>=
PWM_CHANNEL_COUNT
)
return
-
EINVAL
;
pwm
=
&
ec
->
pwm
[
req
->
index
];
resp
->
duty
=
pwm
->
duty
;
len
=
sizeof
(
*
resp
);
break
;
}
case
EC_CMD_PWM_SET_DUTY
:
{
const
struct
ec_params_pwm_set_duty
*
req
=
req_data
;
struct
ec_pwm_channel
*
pwm
;
if
(
req
->
pwm_type
!=
EC_PWM_TYPE_GENERIC
)
return
-
EINVAL
;
if
(
req
->
index
>=
PWM_CHANNEL_COUNT
)
return
-
EINVAL
;
pwm
=
&
ec
->
pwm
[
req
->
index
];
pwm
->
duty
=
req
->
duty
;
len
=
0
;
break
;
}
default:
printf
(
" ** Unknown EC command %#02x
\n
"
,
req_hdr
->
command
);
return
-
1
;
...
...
@@ -619,6 +653,19 @@ void sandbox_cros_ec_set_test_flags(struct udevice *dev, uint flags)
ec
->
test_flags
=
flags
;
}
int
sandbox_cros_ec_get_pwm_duty
(
struct
udevice
*
dev
,
uint
index
,
uint
*
duty
)
{
struct
ec_state
*
ec
=
dev_get_priv
(
dev
);
struct
ec_pwm_channel
*
pwm
;
if
(
index
>=
PWM_CHANNEL_COUNT
)
return
-
ENOSPC
;
pwm
=
&
ec
->
pwm
[
index
];
*
duty
=
pwm
->
duty
;
return
0
;
}
int
cros_ec_probe
(
struct
udevice
*
dev
)
{
struct
ec_state
*
ec
=
dev_get_priv
(
dev
);
...
...
drivers/misc/fs_loader.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,9 @@
* Copyright (C) 2018-2019 Intel Corporation <www.intel.com>
*
*/
#define LOG_CATEGORY UCLASS_FS_FIRMWARE_LOADER
#include <common.h>
#include <dm.h>
#include <env.h>
...
...
drivers/misc/i2c_eeprom.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_I2C_EEPROM
#include <common.h>
#include <eeprom.h>
#include <linux/delay.h>
...
...
drivers/misc/misc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
*/
#define LOG_CATEGORY UCLASS_MISC
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/misc/p2sb-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -6,6 +6,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_P2SB
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/misc/pwrseq-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2015 Google, Inc
*/
#define LOG_CATEGORY UCLASS_PWRSEQ
#include <common.h>
#include <dm.h>
#include <pwrseq.h>
...
...
drivers/mmc/mmc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -5,6 +5,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_MMC
#include <common.h>
#include <log.h>
#include <mmc.h>
...
...
drivers/mtd/mtd-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
*/
#define LOG_CATEGORY UCLASS_MTD
#include <common.h>
#include <dm.h>
#include <dm/device-internal.h>
...
...
drivers/mtd/spi/sf-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_SPI_FLASH
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/mux/mux-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -11,6 +11,8 @@
* Jean-Jacques Hiblot <jjhiblot@ti.com>
*/
#define LOG_CATEGORY UCLASS_MUX
#include <common.h>
#include <dm.h>
#include <mux-internal.h>
...
...
drivers/nvme/nvme-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
*/
#define LOG_CATEGORY UCLASS_NVME
#include <common.h>
#include <dm.h>
...
...
drivers/pch/pch-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_PCH
#include <common.h>
#include <dm.h>
#include <pch.h>
...
...
drivers/pci/pci-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_PCI
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/pci_endpoint/pci_ep-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -9,6 +9,8 @@
* Written by Ramon Fried <ramon.fried@gmail.com>
*/
#define LOG_CATEGORY UCLASS_PCI_EP
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/phy/phy-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Jean-Jacques Hiblot <jjhiblot@ti.com>
*/
#define LOG_CATEGORY UCLASS_PHY
#include <common.h>
#include <dm.h>
#include <dm/device_compat.h>
...
...
drivers/pinctrl/pinctrl-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
*/
#define LOG_CATEGORY UCLASS_PINCTRL
#include <common.h>
#include <malloc.h>
#include <asm/global_data.h>
...
...
drivers/power/domain/power-domain-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2016, NVIDIA CORPORATION.
*/
#define LOG_CATEGORY UCLASS_POWER_DOMAIN
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/power/pmic/pmic-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Przemyslaw Marczak <p.marczak@samsung.com>
*/
#define LOG_CATEGORY UCLASS_PMIC
#include <common.h>
#include <fdtdec.h>
#include <errno.h>
...
...
drivers/power/regulator/regulator-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Przemyslaw Marczak <p.marczak@samsung.com>
*/
#define LOG_CATEGORY UCLASS_REGULATOR
#include <common.h>
#include <errno.h>
#include <dm.h>
...
...
drivers/pwm/pwm-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_PWM
#include <common.h>
#include <dm.h>
#include <pwm.h>
...
...
drivers/ram/ram-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_RAM
#include <common.h>
#include <ram.h>
#include <dm.h>
...
...
drivers/remoteproc/rproc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,9 @@
* (C) Copyright 2015
* Texas Instruments Incorporated - http://www.ti.com/
*/
#define LOG_CATEGORY UCLASS_REMOTEPROC
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <common.h>
#include <errno.h>
...
...
drivers/reset/reset-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2016, NVIDIA CORPORATION.
*/
#define LOG_CATEGORY UCLASS_RESET
#include <common.h>
#include <dm.h>
#include <fdtdec.h>
...
...
drivers/rng/rng-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2019, Linaro Limited
*/
#define LOG_CATEGORY UCLASS_RNG
#include <common.h>
#include <dm.h>
#include <rng.h>
...
...
drivers/rtc/rtc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_RTC
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/scsi/scsi-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -8,6 +8,8 @@
* Based on ahci-uclass.c
*/
#define LOG_CATEGORY UCLASS_SCSI
#include <common.h>
#include <dm.h>
#include <scsi.h>
...
...
drivers/serial/serial-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 The Chromium OS Authors.
*/
#define LOG_CATEGORY UCLASS_SERIAL
#include <common.h>
#include <dm.h>
#include <env_internal.h>
...
...
drivers/smem/smem-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2018 Ramon Fried <ramon.fried@gmail.com>
*/
#define LOG_CATEGORY UCLASS_SMEM
#include <common.h>
#include <dm.h>
#include <smem.h>
...
...
drivers/soc/soc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Dave Gerlach <d-gerlach@ti.com>
*/
#define LOG_CATEGORY UCLASS_SOC
#include <common.h>
#include <soc.h>
#include <dm.h>
...
...
drivers/sound/codec-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_AUDIO_CODEC
#include <common.h>
#include <dm.h>
#include <audio_codec.h>
...
...
drivers/sound/i2s-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_I2S
#include <common.h>
#include <dm.h>
#include <i2s.h>
...
...
drivers/sound/sound-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_SOUND
#include <common.h>
#include <dm.h>
#include <i2s.h>
...
...
drivers/spi/spi-emul-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2014 Google, Inc
*/
#define LOG_CATEGORY UCLASS_SPI_EMUL
#include <common.h>
#include <dm.h>
#include <spi.h>
...
...
drivers/spmi/spmi-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -5,6 +5,8 @@
* (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
*/
#define LOG_CATEGORY UCLASS_SPMI
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/sysinfo/sysinfo-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
*/
#define LOG_CATEGORY UCLASS_SYSINFO
#include <common.h>
#include <dm.h>
#include <sysinfo.h>
...
...
drivers/tee/tee-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2018 Linaro Limited
*/
#define LOG_CATEGORY UCLASS_TEE
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/thermal/thermal-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* (C) Copyright 2014 Freescale Semiconductor, Inc
*/
#define LOG_CATEGORY UCLASS_THERMAL
#include <common.h>
#include <dm.h>
#include <thermal.h>
...
...
drivers/timer/timer-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
*/
#define LOG_CATEGORY UCLASS_TIMER
#include <common.h>
#include <clk.h>
#include <cpu.h>
...
...
drivers/ufs/ufs-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -5,6 +5,8 @@
* Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
*/
#define LOG_CATEGORY UCLASS_UFS
#include <common.h>
#include "ufs.h"
#include <dm.h>
...
...
drivers/usb/emul/usb-emul-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_USB_EMUL
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/usb/gadget/udc/udc-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Jean-Jacques Hiblot <jjhiblot@ti.com>
*/
#define LOG_CATEGORY UCLASS_USB_GADGET_GENERIC
#include <common.h>
#include <dm.h>
#include <dm/device-internal.h>
...
...
drivers/usb/host/usb-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -6,6 +6,8 @@
* usb_match_device() modified from Linux kernel v4.0.
*/
#define LOG_CATEGORY UCLASS_USB
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/video/backlight-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_PANEL_BACKLIGHT
#include <common.h>
#include <dm.h>
#include <backlight.h>
...
...
drivers/video/bridge/video-bridge-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_VIDEO_BRIDGE
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/video/display-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright 2014 Google Inc.
*/
#define LOG_CATEGORY UCLASS_DISPLAY
#include <common.h>
#include <dm.h>
#include <display.h>
...
...
drivers/video/dsi-host-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -5,6 +5,8 @@
*
*/
#define LOG_CATEGORY UCLASS_DSI_HOST
#include <common.h>
#include <dm.h>
#include <dsi_host.h>
...
...
drivers/video/panel-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_PANEL
#include <common.h>
#include <dm.h>
#include <panel.h>
...
...
drivers/video/vidconsole-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -7,6 +7,8 @@
* Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
*/
#define LOG_CATEGORY UCLASS_VIDEO_CONSOLE
#include <common.h>
#include <command.h>
#include <console.h>
...
...
drivers/video/video-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright (c) 2015 Google, Inc
*/
#define LOG_CATEGORY UCLASS_VIDEO
#include <common.h>
#include <console.h>
#include <cpu_func.h>
...
...
drivers/video/video_osd-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -4,6 +4,8 @@
* Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
*/
#define LOG_CATEGORY UCLASS_VIDEO_OSD
#include <common.h>
#include <dm.h>
#include <video_osd.h>
...
...
drivers/virtio/virtio-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -15,6 +15,8 @@
* the VirtIO specification v1.0.
*/
#define LOG_CATEGORY UCLASS_VIRTIO
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/w1-eeprom/w1-eeprom-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -10,6 +10,8 @@
*
*/
#define LOG_CATEGORY UCLASS_W1_EEPROM
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/w1/w1-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -12,6 +12,8 @@
*
*/
#define LOG_CATEGORY UCLASS_W1
#include <common.h>
#include <dm.h>
#include <log.h>
...
...
drivers/watchdog/wdt-uclass.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,8 @@
* Copyright 2017 Google, Inc
*/
#define LOG_CATEGORY UCLASS_WDT
#include <common.h>
#include <dm.h>
#include <errno.h>
...
...
drivers/xen/pvblock.c
浏览文件 @
7e58a3a1
...
...
@@ -3,6 +3,9 @@
* (C) 2007-2008 Samuel Thibault.
* (C) Copyright 2020 EPAM Systems Inc.
*/
#define LOG_CATEGORY UCLASS_PVBLOCK
#include <blk.h>
#include <common.h>
#include <dm.h>
...
...
include/dm/uclass.h
浏览文件 @
7e58a3a1
...
...
@@ -84,8 +84,6 @@ struct udevice;
* its children. If non-zero this is the size of this data, to be allocated
* in the child device's parent_plat pointer. This value is only used as
* a fallback if this member is 0 in the driver.
* @ops: Uclass operations, providing the consistent interface to devices
* within the uclass.
* @flags: Flags for this uclass (DM_UC_...)
*/
struct
uclass_driver
{
...
...
@@ -106,7 +104,6 @@ struct uclass_driver {
int
per_device_plat_auto
;
int
per_child_auto
;
int
per_child_plat_auto
;
const
void
*
ops
;
uint32_t
flags
;
};
...
...
test/cmd/pwm.c
浏览文件 @
7e58a3a1
...
...
@@ -18,16 +18,20 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts)
{
struct
udevice
*
dev
;
/* cros-ec-pwm */
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
0
,
&
dev
));
ut_assertnonnull
(
dev
);
ut_assertok
(
console_record_reset_enable
());
/* pwm <invert> <pwm_dev_num> <channel> <polarity> */
ut_assertok
(
run_command
(
"pwm invert 0 0 1"
,
0
));
/* cros-ec-pwm doesn't support invert */
ut_asserteq
(
1
,
run_command
(
"pwm invert 0 0 1"
,
0
));
ut_assert_nextline
(
"error(-38)"
)
ut_assert_console_end
();
ut_assertok
(
run_command
(
"pwm invert 0 0 0"
,
0
));
ut_asserteq
(
1
,
run_command
(
"pwm invert 0 0 0"
,
0
));
ut_assert_nextline
(
"error(-38)"
)
ut_assert_console_end
();
/* pwm <config> <pwm_dev_num> <channel> <period_ns> <duty_ns> */
...
...
@@ -41,6 +45,30 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts)
ut_assertok
(
run_command
(
"pwm disable 0 0"
,
0
));
ut_assert_console_end
();
/* sandbox-pwm */
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
1
,
&
dev
));
ut_assertnonnull
(
dev
);
ut_assertok
(
console_record_reset_enable
());
/* pwm <invert> <pwm_dev_num> <channel> <polarity> */
ut_assertok
(
run_command
(
"pwm invert 1 0 1"
,
0
));
ut_assert_console_end
();
ut_assertok
(
run_command
(
"pwm invert 1 0 0"
,
0
));
ut_assert_console_end
();
/* pwm <config> <pwm_dev_num> <channel> <period_ns> <duty_ns> */
ut_assertok
(
run_command
(
"pwm config 1 0 10 50"
,
0
));
ut_assert_console_end
();
/* pwm <enable/disable> <pwm_dev_num> <channel> */
ut_assertok
(
run_command
(
"pwm enable 1 0"
,
0
));
ut_assert_console_end
();
ut_assertok
(
run_command
(
"pwm disable 1 0"
,
0
));
ut_assert_console_end
();
return
0
;
}
...
...
test/dm/Makefile
浏览文件 @
7e58a3a1
...
...
@@ -30,6 +30,7 @@ obj-$(CONFIG_DM_BOOTCOUNT) += bootcount.o
obj-$(CONFIG_CLK)
+=
clk.o clk_ccf.o
obj-$(CONFIG_CPU)
+=
cpu.o
obj-$(CONFIG_CROS_EC)
+=
cros_ec.o
obj-$(CONFIG_PWM_CROS_EC)
+=
cros_ec_pwm.o
obj-$(CONFIG_DEVRES)
+=
devres.o
obj-$(CONFIG_DMA)
+=
dma.o
obj-$(CONFIG_VIDEO_MIPI_DSI)
+=
dsi_host.o
...
...
test/dm/cros_ec_pwm.c
0 → 100644
浏览文件 @
7e58a3a1
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
#include <cros_ec.h>
#include <dm.h>
#include <pwm.h>
#include <asm/test.h>
#include <dm/test.h>
#include <test/test.h>
#include <test/ut.h>
static
int
dm_test_cros_ec_pwm
(
struct
unit_test_state
*
uts
)
{
struct
udevice
*
pwm
;
struct
udevice
*
ec
;
uint
duty
;
ut_assertok
(
uclass_get_device_by_name
(
UCLASS_PWM
,
"cros-ec-pwm"
,
&
pwm
));
ut_assertnonnull
(
pwm
);
ec
=
dev_get_parent
(
pwm
);
ut_assertnonnull
(
ec
);
ut_assertok
(
pwm_set_config
(
pwm
,
0
,
100
,
50
));
ut_assertok
(
pwm_set_enable
(
pwm
,
0
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
0
,
&
duty
));
ut_asserteq
(
50
*
EC_PWM_MAX_DUTY
/
100
,
duty
);
ut_assertok
(
pwm_set_config
(
pwm
,
0
,
15721
,
2719
));
ut_assertok
(
pwm_set_enable
(
pwm
,
0
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
0
,
&
duty
));
ut_asserteq
(
2719
*
EC_PWM_MAX_DUTY
/
15721
,
duty
);
ut_assertok
(
pwm_set_enable
(
pwm
,
0
,
false
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
0
,
&
duty
));
ut_asserteq
(
0
,
duty
);
ut_assertok
(
pwm_set_enable
(
pwm
,
0
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
0
,
&
duty
));
ut_asserteq
(
2719
*
EC_PWM_MAX_DUTY
/
15721
,
duty
);
ut_assertok
(
pwm_set_config
(
pwm
,
1
,
1000
,
0
));
ut_assertok
(
pwm_set_enable
(
pwm
,
1
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
1
,
&
duty
));
ut_asserteq
(
0
,
duty
);
ut_assertok
(
pwm_set_config
(
pwm
,
2
,
1000
,
1024
));
ut_assertok
(
pwm_set_enable
(
pwm
,
2
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
2
,
&
duty
));
ut_asserteq
(
EC_PWM_MAX_DUTY
,
duty
);
ut_assertok
(
pwm_set_config
(
pwm
,
3
,
EC_PWM_MAX_DUTY
,
0xABCD
));
ut_assertok
(
pwm_set_enable
(
pwm
,
3
,
true
));
ut_assertok
(
sandbox_cros_ec_get_pwm_duty
(
ec
,
3
,
&
duty
));
ut_asserteq
(
0xABCD
,
duty
);
ut_asserteq
(
-
EINVAL
,
pwm_set_enable
(
pwm
,
4
,
true
));
return
0
;
}
DM_TEST
(
dm_test_cros_ec_pwm
,
UT_TESTF_SCAN_PDATA
|
UT_TESTF_SCAN_FDT
);
test/dm/panel.c
浏览文件 @
7e58a3a1
...
...
@@ -28,7 +28,7 @@ static int dm_test_panel(struct unit_test_state *uts)
bool
polarity
;
ut_assertok
(
uclass_first_device_err
(
UCLASS_PANEL
,
&
dev
));
ut_assertok
(
uclass_
first_device_err
(
UCLASS_PWM
,
&
pwm
));
ut_assertok
(
uclass_
get_device_by_name
(
UCLASS_PWM
,
"pwm"
,
&
pwm
));
ut_assertok
(
uclass_get_device
(
UCLASS_GPIO
,
1
,
&
gpio
));
ut_assertok
(
regulator_get_by_platname
(
"VDD_EMMC_1.8V"
,
&
reg
));
ut_assertok
(
sandbox_pwm_get_config
(
pwm
,
0
,
&
period_ns
,
&
duty_ns
,
...
...
test/dm/pwm.c
浏览文件 @
7e58a3a1
...
...
@@ -20,7 +20,7 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
bool
enable
;
bool
polarity
;
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
0
,
&
dev
));
ut_assertok
(
uclass_get_device
_by_name
(
UCLASS_PWM
,
"pwm"
,
&
dev
));
ut_assertnonnull
(
dev
);
ut_assertok
(
pwm_set_config
(
dev
,
0
,
100
,
50
));
ut_assertok
(
pwm_set_enable
(
dev
,
0
,
true
));
...
...
@@ -35,8 +35,10 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
ut_asserteq
(
period_ns
,
4096
);
ut_asserteq
(
duty_ns
,
50
*
4096
/
100
);
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
0
,
&
dev
));
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
1
,
&
dev
));
ut_asserteq
(
-
ENODEV
,
uclass_get_device
(
UCLASS_PWM
,
2
,
&
dev
));
ut_assertok
(
uclass_get_device
(
UCLASS_PWM
,
2
,
&
dev
));
ut_asserteq
(
-
ENODEV
,
uclass_get_device
(
UCLASS_PWM
,
3
,
&
dev
));
return
0
;
}
...
...
tools/patman/tools.py
浏览文件 @
7e58a3a1
...
...
@@ -292,8 +292,6 @@ def GetTargetCompileTool(name, cross_compile=None):
if
cross_compile
is
None
:
cross_compile
=
env
.
get
(
'CROSS_COMPILE'
,
''
)
if
not
cross_compile
:
return
name
,
[]
if
name
in
(
'as'
,
'ar'
,
'nm'
,
'ldr'
,
'strip'
,
'objcopy'
,
'objdump'
):
target_name
=
cross_compile
+
name
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录