[U-Boot] [RFC] ns16550: Add support for AUX regs usage on some ARC SoCs

Simon Glass sjg at chromium.org
Fri Feb 23 20:59:41 UTC 2018


Hi Alexey,

On 23 February 2018 at 11:08, Alexey Brodkin
<Alexey.Brodkin at synopsys.com> wrote:
> Hi Simon,
>
> On Thu, 2018-02-22 at 10:29 -0700, Simon Glass wrote:
>> Hi Alexey,
>>
>> On 22 February 2018 at 09:23, Alexey Brodkin
>> <Alexey.Brodkin at synopsys.com> wrote:
>> > Hi Simon,
>> >
>> > On Thu, 2018-02-22 at 09:17 -0700, Simon Glass wrote:
>> > > Hi,
>> > >
>> > > On 21 February 2018 at 05:26, Alexey Brodkin
>> > > <Alexey.Brodkin at synopsys.com> wrote:
>
> [snip]
>
>> > > > ---
>> > > >  drivers/serial/ns16550.c | 11 +++++++++--
>> > > >  1 file changed, 9 insertions(+), 2 deletions(-)
>> > >
>> > > I think a separate driver might be better, unless we want to make the
>> > > read/write interface go through regmap or similar?
>> >
>> > But in case of ARC's AUX regs portmap won't help because those AUX regs are
>> > couldn't be mapped - that a completely different address space and we may
>> > only access them via dedicated instructions (LR vs LD and SR vs ST).
>>
>> Well...
>>
>> 1. With a separate driver, you can do whatever you want :-) I know it
>> introduces code duplication though...
>>
>> 2. With regmap you can add your own regmap driver, and again do
>> whatever you want. I can help with that if it sounds attractive
>
> That sounds definitely interesting!
> Are there any pointers on how that usually done?

Not yet. My ideas:

- Add a new regmap_init_xxx() function
- Adjust the regmap structure to allow read()/write() function
pointers to be provided
- Adjust the regmap code to call them, instead of the hard-coded
memory-mapped ones
- Adjust ns16550 to call regmap instead of readl/writel

This should clean up the mess in ns16550 a bit. But it will require a
bit of investigation / thinking.

Regards,
Simon


More information about the U-Boot mailing list