aboutsummaryrefslogtreecommitdiff
path: root/include/ns16550.h
diff options
context:
space:
mode:
authorSimon Glass2023-09-26 08:14:58 -0600
committerTom Rini2023-10-06 14:38:13 -0400
commitf69d3d6d10b15872a279aeb10b7c522627aff6c2 (patch)
treefcabaf4a86164f385ede03b654bc69cbffb2a3ee /include/ns16550.h
parent61fc132051740e0378a5e71f3db6cb1581e970fe (diff)
pci: serial: Support reading PCI-register size with base
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/ns16550.h')
-rw-r--r--include/ns16550.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ns16550.h b/include/ns16550.h
index e7e68663d03..7f481300083 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -58,6 +58,7 @@ enum ns16550_flags {
* struct ns16550_plat - information about a NS16550 port
*
* @base: Base register address
+ * @size: Size of register area in bytes
* @reg_width: IO accesses size of registers (in bytes, 1 or 4)
* @reg_shift: Shift size of registers (0=byte, 1=16bit, 2=32bit...)
* @reg_offset: Offset to start of registers (normally 0)
@@ -67,7 +68,8 @@ enum ns16550_flags {
* @bdf: PCI slot/function (pci_dev_t)
*/
struct ns16550_plat {
- unsigned long base;
+ ulong base;
+ ulong size;
int reg_width;
int reg_shift;
int reg_offset;