aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
AgeCommit message (Collapse)AuthorFilesLines
2019-12-02common: Move command functions out of common.hSimon Glass1-0/+1
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>
2019-12-02common: Move interrupt functions into a new headerSimon Glass1-0/+1
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>
2019-12-02common: Move ARM cache operations out of common.hSimon Glass1-0/+1
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>
2019-11-17Merge tag 'dm-pull-14nov19' of git://git.denx.de/u-boot-dmTom Rini1-2/+2
Add OP-TEE test swuit Fix patman cc_file output Minor sandbox/pinctrl changes
2019-11-14Merge tag 'efi-2020-01-rc3' of ↵Tom Rini3-0/+92
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-01-rc3 The following changes for the UEFI subsystem are provided: * allow building UEFI binaries on the sandbox * enable access to file systems without partition tables * correctly check the return value of efi_dp_from_file()
2019-11-14sandbox: use correct type reading /proc/self/mapsHeinrich Schuchardt1-2/+2
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>
2019-11-12efi_loader: support building UEFI binaries on sandboxHeinrich Schuchardt3-0/+92
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>
2019-11-01Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dmTom Rini3-8/+17
- Fix for patman with email addresses containing commas - Bootstage improvements for TPL, SPL - Various sandbox and dm improvements and fixes
2019-10-27sandbox: test: Add a prototype for sandbox_set_enable_memio()Simon Glass1-0/+11
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>
2019-10-27sandbox: Drop 'const' from sandbox_write()Simon Glass2-8/+6
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>
2019-10-22test: clk: test clock self assignmentJean-Jacques Hiblot1-0/+2
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>
2019-10-22test: clk: Update tests to also check the managed APIJean-Jacques Hiblot2-2/+37
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>
2019-10-15sandbox: fix build error due to missing struct udevice definitionAKASHI Takahiro1-0/+2
Without this patch, compiling may potentially fail. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-10-15sandbox: fix cpu property in test.dts for pytestAKASHI Takahiro1-11/+13
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>
2019-10-13dm: Add a dsi host uclassYannick Fertré2-1/+9
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>
2019-10-08sandbox: pci: Create a new sandbox_pci_read_bar() functionSimon Glass1-0/+15
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>
2019-10-08dm: pci: Add a function to read a PCI BARSimon Glass1-2/+5
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>
2019-10-08pci: sandbox: Move the emulators into their own nodeSimon Glass2-16/+33
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 4345998ae9df in sandbox_pci_get_emul()] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08sandbox: Allow use of real I/O with readl(), etc.Simon Glass3-9/+72
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>
2019-10-08sandbox: pci: Increase the memory spaceSimon Glass1-1/+1
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>
2019-10-08sandbox: Add a -T flag to use the test device treeSimon Glass1-0/+25
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>
2019-10-08sandbox: Add support for clrsetio_32() and friendsSimon Glass2-12/+42
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>
2019-10-08sandbox: Rename PCI ID for swap_case to be more specificSimon Glass1-1/+1
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>
2019-10-08sandbox: spmi: Add ranges property for address translationSimon Glass1-0/+2
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>
2019-10-08spl: Add an arch-specific hook for writing to SPL handoffSimon Glass1-0/+7
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>
2019-08-19sysreset: switch to using SYSRESET_POWER_OFF for poweroffUrja Rannikko1-1/+0
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>
2019-07-29doc: arch: sandbox: Replace all the instances of README.sandboxKeerthy1-1/+1
commit 49116e6d236d ("doc: arch: Convert README.sandbox to reST") Moves README.sandbox to doc/arch. Replace all the existing instances to point to the right documentation file. Signed-off-by: Keerthy <j-keerthy@ti.com>
2019-07-27Merge tag 'u-boot-imx-20190719' of ↵Tom Rini1-0/+10
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
2019-07-23Merge tag 'u-boot-stm32-20190723' of ↵Tom Rini1-0/+4
https://gitlab.denx.de/u-boot/custodians/u-boot-stm - add rtc driver for stm32mp1 - add remoteproc driver for stm32mp1 - use kernel qspi compatible string for stm32
2019-07-22dm: core: Introduce xxx_translate_dma_address()Fabien Dessenne1-0/+4
Add the following functions to translate DMA address to CPU address: - dev_translate_dma_address() - ofnode_translate_dma_address() - of_translate_dma_address() - fdt_translate_dma_address() These functions work the same way as xxx_translate_address(), with the difference that the translation relies on the "dma-ranges" property instead of the "ranges" property. Add related test. Test report: => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c Test: dm_test_fdt_translation: test-fdt.c (flat tree) Failures: 0 Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2019-07-19clk: sandbox: Add sandbox test code for Common Clock Framework [CCF]Lukasz Majewski1-0/+4
This patch provides code to implement the CCF clock tree in sandbox. It uses all the introduced primitives; some generic ones are reused, some sandbox specific were developed. In that way (after introducing the real CCF tree in sandbox) the recently added to clk-uclass.c: clk_get_by_id() and clk_get_parent_rate() are tested in their natural work environment. Usage (sandbox_defconfig and sandbox_flattree_defconfig): ./u-boot --fdt arch/sandbox/dts/test.dtb --command "ut dm clk_ccf" Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-07-19dts: sandbox: Add 'osc' clock for Common Clock Framework [CCF] testingLukasz Majewski1-0/+6
This patch adds the 'osc' fixed clock to facilitate the CCF testing in the sandbox U-Boot. It is a starting point for building CCF hierarchy of clocks. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-07-18test: dm: add a test for MDIO MUX DM uclassAlex Marginean1-1/+22
Adds a test using a makeshift MDIO MUX. The test is based on the existing MDIO test. It uses the last emulated PHY register to verify MUX selection. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-15test: dm: add MDIO testAlex Marginean1-0/+4
A very simple test for DM_MDIO, mimicks a register write/read through the sandbox bus to a dummy PHY. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-11Merge tag 'dm-pull-9jul19-take2' of ↵Tom Rini8-599/+406
https://gitlab.denx.de/u-boot/custodians/u-boot-dm - Sandbox improvements including .dts refactor - Minor tracing and PCI improvements - Various other minor fixes - Conversion of patman, dtoc and binman to support Python 3
2019-07-11test: pci_ep: add basic pci_ep testsRamon Fried1-0/+8
Add basic PCI endpoint sandbox testing. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-11pci_ep: add pci endpoint sandbox driverRamon Fried1-0/+4
Add a dummy PCI endpoint for sandbox. Supporting only a single function, it allows setting and reading header configuration. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-10test: dm: Add a test for PCI Enhanced AllocationAlex Marginean2-0/+21
This test is built on top of the existing swap_case driver. It adds EA capability structure support to swap_case and uses that to map BARs. BAR1 works as it used to, swapping upper/lower case. BARs 2,4 map to a couple of magic values. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-10test: check u-boot properties in SPL device treePatrick Delaunay1-0/+18
Add a test to check the management of the U-boot relocation properties for device tree SPL generation (fdtgrep result) and platdata: - 'dm-pre-proper' and 'dm-tpl' not included in SPL - 'dm-pre-reloc' and 'dm-spl' included in SPL Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Correct spi flash operationSimon Glass1-1/+1
Since the SPI nor conversion, 'sf probe' does not work on sandbox. Fix this by using the expected compatible string in the flash node. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: cd35365762 (mtd: sf_probe: remove spi-flash compatible)
2019-07-10sandbox: Add a memory {} nodeSimon Glass2-0/+12
Add a memory node which indicates the size of sandbox memory. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Allo sdl-config to be overriddenSimon Glass1-2/+3
When cross-compiling, sometimes sdl-config must come from a different path from the default. Add a way to override it, by adding SDL_CONFIG to the environment before building U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Add a comment to board_init_f()Simon Glass1-0/+1
This function is used for both SPL and TPL. Add a comment to that effect. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: spl: Lower priority of standard loaderSimon Glass1-1/+1
We normally want to load U-Boot from SPL, but if a board wants to do something else, it is currently not possible since the standard loader has the top priority. Lower it to allow other SPL_LOAD_IMAGE_METHOD() declarations to override it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Exit when SYSRESET_POWER_OFF is requestedSimon Glass1-0/+1
At present this returns but it seems better to just exit sandbox immediately. Signed-off-by: Simon Glass <sjg@chromium.org> reset
2019-07-10sandbox: Add an alias for SPISimon Glass2-2/+4
At present 'sf probe' does not work since it cannot find SPI bus 0. Add an alias to correct this, now that we no-longer have the --spi_sf option. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Create a common sandbox DTSimon Glass3-664/+348
At present sandbox and sandbox64 have duplicated nodes. This is hard to maintain since changes in one need to be manually added to the other. Create a common file to solve this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10sandbox: Sync up sandbox64.dts with main DTSimon Glass1-0/+67
Various nodes have been added and adjusted with sandbox. Move these changes over to sandbox64.dts to keep these in sync. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-05dm: Add a No-op uclassJean-Jacques Hiblot1-0/+12
This uclass is intended for devices that do not need any features from the uclass, including binding children. This will typically be used by devices that are used to bind child devices but do not use dm_scan_fdt_dev() to do it. That is for example the case of several USB wrappers that have 2 child devices (1 for device and 1 for host) but bind only one at a any given time. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-04-24Merge tag 'pull-24apr19' of git://git.denx.de/u-boot-dmTom Rini3-14/+62
Various minor sandbox iumprovements Fixes for tracing with sandbox Refactoring for boot_get_fdt()