mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	Compiling with gcc 13 results in an error:
    drivers/axi/axi-emul-uclass.c:16:5: warning: conflicting types for
    ‘axi_sandbox_get_emul’ due to enum/integer mismatch; have
    ‘int(struct udevice *, ulong,  enum axi_size_t,  struct udevice **)’
    {aka ‘int(struct udevice *, long unsigned int,  enum axi_size_t,
    struct udevice **)’} [-Wenum-int-mismatch]
       16 | int axi_sandbox_get_emul(struct udevice *bus, ulong address,
          |     ^~~~~~~~~~~~~~~~~~~~
    In file included from drivers/axi/axi-emul-uclass.c:14:
    ./arch/sandbox/include/asm/axi.h:48:5: note: previous declaration of
    ‘axi_sandbox_get_emul’ with type ‘int(struct udevice *, ulong,  uint,
    struct udevice **)’ {aka ‘int(struct udevice *, long unsigned int,
    unsigned int,  struct udevice **)’}
       48 | int axi_sandbox_get_emul(struct udevice *bus, ulong address, uint length,
          |     ^~~~~~~~~~~~~~~~~~~~
Adjust the header definition to match the implementation.
Define the size parameter as constant.
Fixes: 9a8bcabd8a ("axi: Add AXI sandbox driver and simple emulator")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
		
	
		
			
				
	
	
		
			67 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0+ */
 | |
| /*
 | |
|  * (C) Copyright 2018
 | |
|  * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
 | |
|  */
 | |
| 
 | |
| #ifndef __asm_axi_h
 | |
| #define __asm_axi_h
 | |
| 
 | |
| #define axi_emul_get_ops(dev)	((struct axi_emul_ops *)(dev)->driver->ops)
 | |
| 
 | |
| /**
 | |
|  * axi_sandbox_get_emul() - Retrieve a pointer to a AXI emulation device
 | |
|  * @bus:     The AXI bus from which to retrieve a emulation device
 | |
|  * @address: The address of a transfer that should be handled by a emulation
 | |
|  *	     device
 | |
|  * @size:    A constant indicating the data width of the transfer that
 | |
|  *	     should be handled by an emulation device
 | |
|  * @emulp:   Pointer to a buffer receiving the emulation device that handles
 | |
|  *	     the transfer specified by the address and length parameters
 | |
|  *
 | |
|  * To test the AXI uclass, we implement a simple AXI emulation device, which is
 | |
|  * a virtual device on a AXI bus that exposes a simple storage interface: When
 | |
|  * reading and writing from the device, the addresses are translated to offsets
 | |
|  * within the device's storage. For write accesses the data is written to the
 | |
|  * specified storage offset, and for read accesses the data is read from the
 | |
|  * specified storage offset.
 | |
|  *
 | |
|  * A DTS entry might look like this:
 | |
|  *
 | |
|  * axi: axi@0 {
 | |
|  *	compatible = "sandbox,axi";
 | |
|  *	#address-cells = <0x1>;
 | |
|  *	#size-cells = <0x1>;
 | |
|  *	store@0 {
 | |
|  *		compatible = "sandbox,sandbox_store";
 | |
|  *		reg = <0x0 0x400>;
 | |
|  *	};
 | |
|  * };
 | |
|  *
 | |
|  * This function may then be used to retrieve the pointer to the sandbox_store
 | |
|  * emulation device given the AXI bus device, and the data (address, data
 | |
|  * width) of a AXI transfer which should be handled by a emulation device.
 | |
|  *
 | |
|  * Return: 0 of OK, -ENODEV if no device capable of handling the specified
 | |
|  *	   transfer exists or the device could not be retrieved
 | |
|  */
 | |
| int axi_sandbox_get_emul(struct udevice *bus, ulong address,
 | |
| 			 const enum axi_size_t size, struct udevice **emulp);
 | |
| /**
 | |
|  * axi_get_store() - Get address of internal storage of a emulated AXI device
 | |
|  * @dev:	Emulated AXI device to get the pointer of the internal storage
 | |
|  *		for.
 | |
|  * @storep:	Pointer to the internal storage of the emulated AXI device.
 | |
|  *
 | |
|  * To preset or read back the contents internal storage of the emulated AXI
 | |
|  * device, this function returns the pointer to the storage. Changes to the
 | |
|  * contents of the storage are reflected when using the AXI read/write API
 | |
|  * methods, and vice versa, so by using this method expected read data can be
 | |
|  * set up in advance, and written data can be checked in unit tests.
 | |
|  *
 | |
|  * Return: 0 if OK, -ve on error.
 | |
|  */
 | |
| int axi_get_store(struct udevice *dev, u8 **storep);
 | |
| 
 | |
| #endif /* __asm_axi_h */
 |