aboutsummaryrefslogtreecommitdiff
path: root/include/serial.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-26 08:14:58 -0600
committerTom Rini <trini@konsulko.com>2023-10-06 14:38:13 -0400
commitf69d3d6d10b15872a279aeb10b7c522627aff6c2 (patch)
treefcabaf4a86164f385ede03b654bc69cbffb2a3ee /include/serial.h
parent61fc132051740e0378a5e71f3db6cb1581e970fe (diff)
downloadu-boot-f69d3d6d10b15872a279aeb10b7c522627aff6c2.zip
u-boot-f69d3d6d10b15872a279aeb10b7c522627aff6c2.tar.gz
u-boot-f69d3d6d10b15872a279aeb10b7c522627aff6c2.tar.bz2
pci: serial: Support reading PCI-register size with baseWIP/2023-10-06-spl-prepare-for-universal-payload
The PCI helpers read only the base address for a PCI region. In some cases the size is needed as well, e.g. to pass along to a driver which needs to know the size of its register area. Update the functions to allow the size to be returned. For serial, record the information and provided it with the serial_info() call. A limitation still exists in that the size is not available when OF_LIVE is enabled, so take account of that in the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/serial.h')
-rw-r--r--include/serial.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/serial.h b/include/serial.h
index 42bdf37..205889d 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -137,6 +137,7 @@ enum adr_space_type {
* @type: type of the UART chip
* @addr_space: address space to access the registers
* @addr: physical address of the registers
+ * @size: size of the register area in bytes
* @reg_width: size (in bytes) of the IO accesses to the registers
* @reg_offset: offset to apply to the @addr from the start of the registers
* @reg_shift: quantity to shift the register offsets by
@@ -147,6 +148,7 @@ struct serial_device_info {
enum serial_chip_type type;
enum adr_space_type addr_space;
ulong addr;
+ ulong size;
u8 reg_width;
u8 reg_offset;
u8 reg_shift;