[PATCH v3 38/38] pci: serial: Support reading PCI-register size with base

Tom Rini trini at konsulko.com
Tue Sep 26 16:05:00 CEST 2023


On Tue, Sep 26, 2023 at 05:37:32AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 25 Sept 2023 at 14:17, Tom Rini <trini at konsulko.com> wrote:
> >
> > On Sun, Sep 24, 2023 at 01:25:23PM -0600, Simon Glass wrote:
> >
> > > 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 at chromium.org>
> >
> > So on platforms that end up here, we see consistently:
> >             eaidk-610-rk3399: all +224 spl/u-boot-spl:all +224 spl/u-boot-spl:text +224 text +224 tpl/u-boot-tpl:all +224 tpl/u-boot-tpl:text +224
> >                u-boot: add: 2/0, grow: 3/0 bytes: 224/0 (224)
> >                  function                                   old     new   delta
> >                  fdtdec_get_addr_size_auto_noparent           -     124    +124
> >                  devfdt_get_addr_size_index                   -      72     +72
> >                  ns16550_serial_of_to_plat                  316     328     +12
> >                  ns16550_serial_probe                       132     140      +8
> >                  ns16550_serial_getinfo                      84      92      +8
> >                tpl-u-boot-tpl: add: 2/0, grow: 3/0 bytes: 224/0 (224)
> >                  function                                   old     new   delta
> >                  fdtdec_get_addr_size_auto_noparent           -     124    +124
> >                  devfdt_get_addr_size_index                   -      72     +72
> >                  ns16550_serial_of_to_plat                  316     328     +12
> >                  ns16550_serial_probe                       132     140      +8
> >                  ns16550_serial_getinfo                      84      92      +8
> >                spl-u-boot-spl: add: 2/0, grow: 3/0 bytes: 224/0 (224)
> >                  function                                   old     new   delta
> >                  fdtdec_get_addr_size_auto_noparent           -     124    +124
> >                  devfdt_get_addr_size_index                   -      72     +72
> >                  ns16550_serial_of_to_plat                  316     328     +12
> >                  ns16550_serial_probe                       132     140      +8
> >                  ns16550_serial_getinfo                      84      92      +8
> >
> > Can we optimize this in any way? I'm less concerned with full U-Boot
> > growing by 224 bytes than I am by TPL growing by that much too.
> 
> One option would be to have two functions in each case, one for the
> address and one for the address + size. We do that in some other
> cases. I have to admit I somehow didn't notice this large size
> difference, although I knew it would have an impact...it is so strange
> how the compiler changes what functions end up in the image willy
> nilly.

Yes, please take a look.  But note that it's not arbitrary, setting
aside the EFI application build, we garbage collect things that cannot
be called :)

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230926/9c7f779d/attachment.sig>


More information about the U-Boot mailing list