- Feb 06, 2020
-
-
Simon Glass authored
Some sandbox files are not built with U-Boot headers, so with the renamed malloc functions there is now no need to use the special os_... allocation functions to access the system routines. Instead we can just call them directly. Update the affected files accordingly. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This name conflicts with our desire to #define free() to something else on sandbox. Rename it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
At present options are presented in essentially random order. It is easier to browse them if they are sorted into alphabetical order. Adjust the help function to handle this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Sean Anderson authored
If CONFIG_CMDLINE=n, common/cli.c calls board_run_command. This fails to link on most architectures. However, the sandbox architecture has an implementation which we can use. Signed-off-by:
Sean Anderson <seanga2@gmail.com>
-
Simon Glass authored
Add a function to read a property from the chosen node, providing access to its length. Update ofnode_get_chosen_string() to make use of it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is actually intended to read a string rather than a property. All of its current callers use it that way. Also there is no way to return the length of the property from this function. Rename it to better indicate its purpose, using ofnode_read as the prefix since this matches most other functions. Also add some tests which are missing for these functions. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 24, 2020
-
-
Simon Glass authored
At present panic() is in the vsprintf.h header file. That does not seem like an obvious choice for hang(), even though it relates to panic(). So let's put hang() in its own header. Signed-off-by:
Simon Glass <sjg@chromium.org> [trini: Migrate a few more files] Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jan 17, 2020
-
-
Simon Glass authored
At present panic() is in the vsprintf.h header file. That does not seem like an obvious choice for hang(), even though it relates to panic(). So let's put hang() in its own header. Signed-off-by:
Simon Glass <sjg@chromium.org> [trini: Migrate a few more files] Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jan 07, 2020
-
-
Simon Glass authored
Add a driver which does devres allocations so that we can write tests for devres. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Sughosh Ganu authored
Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by:
Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by:
Patrice Chotard <patrice.chotard@st.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Dec 17, 2019
-
-
Robert Beckett authored
Add support for setting the chip address offset mask to EEPROM sumulator and add tests to test it. Signed-off-by:
Robert Beckett <bob.beckett@collabora.com> Reviewed-by:
Heiko Schocher <hs@denx.de>
-
Robert Beckett authored
Improve i2c EEPROM simulator testing by providing access functions to check the previous chip addr and offset. Given that we can now directly test the offsets, also simplified the offset mapping and allow for wrapping acceses. Signed-off-by:
Robert Beckett <bob.beckett@collabora.com> Reviewed-by:
Heiko Schocher <hs@denx.de>
-
- Dec 15, 2019
-
-
Simon Glass authored
Add a simple sandbox test for this uclass. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
Add a sandbox driver and PCI-device emulator for p2sb. Also add a test which uses a simple 'adder' driver to test the p2sb functionality. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
When reseting sandbox for tests, disable mmio support since that is the default state. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
Add a simple PMC for sandbox to permit tests to run. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Dec 10, 2019
-
-
Heinrich Schuchardt authored
In the device tree UEFI unit test the compatible property of the device is read. Provide the missing property. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Dec 02, 2019
-
-
Simon Glass authored
Move these functions into the command.h header file which is a better fit. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
These functions do not use driver model but are fairly widely used in U-Boot. But it is not clear that they will use driver model anytime soon, so we don't want to label them as 'legacy'. Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it is widely used in U-Boot already. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
These functions are CPU-related and do not use driver model. Move them to cpu_func.h Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Nov 14, 2019
-
-
Heinrich Schuchardt authored
Compiling arch/sandbox/cpu/os.c results in an error ../arch/sandbox/cpu/os.c: In function ‘os_find_text_base’: ../arch/sandbox/cpu/os.c:823:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 823 | base = (void *)addr; | ^ cc1: all warnings being treated as errors The size of void* differs from that of unsigned long long on 32bit systems. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Nov 12, 2019
-
-
Heinrich Schuchardt authored
On the sandbox the UEFI binaries must match the host architectures. Adjust the Makefiles. Provide the PE/COFF header and relocation files. Allow building helloworld.efi on the sandbox. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Oct 27, 2019
-
-
Simon Glass authored
This function needs a prototype so that tests can use it. Add one. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
This function writes to its address so the address should not be declared as const. Fix it. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Oct 22, 2019
-
-
Jean-Jacques Hiblot authored
Make sure that the clock self-assignment works by having a clock of clk-sbox be configured automatically when clk-sbox is probed. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
Add a few more clocks the clk_sandbox clock provider and get them using the managed API. Make sure they are released when the device is removed. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
- Oct 15, 2019
-
-
AKASHI Takahiro authored
Without this patch, compiling may potentially fail. Signed-off-by:
AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
AKASHI Takahiro authored
When I tried to run some new efi tests with pytest, efi_smbios_register() triggered a segmentation fault. Here is the location where it happened: efi_init_obj_list() efi_smbios_register() write_smbios_table() smbios_write_type4() smbios_write_type4_dm() where dev_get_parent_platdata() should return a pointer to struct cpu_platdata, but it is actually NULL because any cpu device on sandbox is attached to "root_driver." With this patch, this issue will be fixed by moving all the definitions of cpus under "cpus" node so that they have a "cpu_bus" parent. Signed-off-by:
AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Oct 13, 2019
-
-
Yannick Fertré authored
Display Serial Interface (DSI) host can usefully be modelled as their own uclass. DSI defines a serial bus and a communication protocol between the host and the device (panel, bridge). Signed-off-by:
Yannick Fertré <yannick.fertre@st.com>
-
- Oct 08, 2019
-
-
Simon Glass authored
The code in swapcase can be used by other sandbox drivers. Move it into a common place to allow this. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> [bmeng: remove inclusion of <asm/test.h> in pci_sandbox.c] Signed-off-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
At present PCI address transaction is not supported so drivers must manually read the correct BAR after reading the device tree info. The ns16550 has a suitable implementation, so move this code into the core DM support. Note that there is no live-tree equivalent at present. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the unclear comments in test.dts] Signed-off-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
Sandbox pci works using emulation drivers which are currently children of the pci device: pci-controller { pci@1f,0 { compatible = "pci-generic"; reg = <0xf800 0 0 0 0>; emul@1f,0 { compatible = "sandbox,swap-case"; }; }; }; In this case the emulation device is attached to pci device on address f800 (device 1f, function 0) and provides the swap-case functionality. However this is not ideal, since every device on a PCI bus has a child device. This is only really the case for sandbox, but we want to avoid special-case code for sandbox. Worse, child devices cannot be probed before their parents. This forces us to use 'find' rather than 'get' to obtain the emulator device. In fact the emulator devices are never probed. There is code in sandbox_pci_emul_post_probe() which tries to track when emulators are active, but at present this does not work. A better approach seems to be to add a separate node elsewhere in the device tree, an 'emulation parent'. This could be given a bogus address (such as -1) to hide the emulators away from the 'pci' command, but it seems better to keep it at the root node to avoid such hacks. Then we can use a phandle to point from the device to the correct emulator, and only on sandbox. The code to find an emulator does not interfere with normal pci operation. Add a new UCLASS_PCI_EMUL_PARENT uclass which allows finding an emulator given a bus, and finding a bus given an emulator. Update the existing device trees and the code for finding an emulator. This brings PCI emulators more into line with I2C. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> [bmeng: fix 3 typos in the commit message; encode bus number in the labels of swap_case_emul nodes; mention commit 4345998a in sandbox_pci_get_emul()] Signed-off-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
At present these functions are stubbed out. For more comprehensive testing with PCI devices it is useful to be able to fully emulate I/O access. Add simple implementations for these. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> [bmeng: change to use 'const void *' in sandbox_write(); cast 'addr' in read/write macros in arch/sandbox/include/asm/io.h; remove the unnecessary cast in readq/writeq in nvme.h] Signed-off-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
Increase the memory space so we can support the p2sb bus which needs multiples of 1MB. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
U-Boot already supports using -D to indicate that it should use the normal device tree. It is sometimes useful to run with the test device tree, e.g. when running a test. Add a -T option for this along with some documentation. It can be used like this: /tmp/b/sandbox/u-boot -T -c "ut dm pci_busdev" (this will use /tmp/b/sandbox/arch/sandbox/dts/test.dtb as the DT) Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
These functions are available on x86 but not sandbox. They are useful shortcuts and clarify the code, so add them to sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
Rename this ID to SANDBOX_PCI_SWAP_CASE_EMUL_ID since it is more descriptive and allows us to add new PCI emulators without any conflict or confusion. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
At present address translation does not work since there is no ranges property in the spmi nodes. Add empty ranges properties and a little more logging so that this shows the error: /tmp/b/sandbox/u-boot -d /tmp/b/sandbox/arch/sandbox/dts/test.dtb \ -c "ut dm spmi_access_peripheral" -L7 -v ... pm8916_gpio_probe() bad address: returning err=-22 Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com>
-
Simon Glass authored
At present there is an arch-specific area in the SPL handoff area intended for use by arch-specific code, but there is no explicit call to fill in this data. Add a hook for this. Also use the hook to remove the sandbox-specific test code from write_spl_handoff(). Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Aug 19, 2019
-
-
Urja Rannikko authored
It seems that SYSRESET_POWER_OFF was added recently, and all previous code used SYSRESET_POWER for poweroff. SYSRESET_POWER is supposed to be a PMIC-level power cycle, not a poweroff. (Comment by Simon Glass) SYSRESET_POWER means to do a power reset (removing and reinstating all power) SYSRESET_POWER_OFF means to turn the device off and leave it off Signed-off-by:
Urja Rannikko <urjaman@gmail.com> Reviewed-by:
Patrick Delaunay <patrick.delaunay@st.com> (Update comment to help understand the patch) Signed-off-by:
Kever Yang <kever.yang@rock-chips.com>
-