[U-Boot] [PATCH] dm: ns16550: Add support for reg-offset property

Simon Glass sjg at chromium.org
Sun Mar 13 02:54:51 CET 2016


Hi,

On 28 February 2016 at 15:39, Alexander Graf <agraf at suse.de> wrote:
>
>
> On 02/25/2016 02:38 PM, Derald D. Woods wrote:
>>
>> On Thu, Feb 25, 2016 at 09:11:24AM +0100, Michal Simek wrote:
>>>
>>> On 25.2.2016 05:47, Derald D. Woods wrote:
>>>>
>>>> On Wed, Feb 24, 2016 at 12:26:09PM +0100, Michal Simek wrote:
>>>>>
>>>>> On 24.2.2016 11:56, Adam Ford wrote:
>>>>>>
>>>>>> On Tue, Feb 23, 2016 at 12:38 AM, Simon Glass <sjg at chromium.org>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Michal,
>>>>>>>
>>>>>>> On 22 February 2016 at 00:40, Michal Simek <michal.simek at xilinx.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> On 19.2.2016 21:55, Simon Glass wrote:
>>>>>>>>>
>>>>>>>>> Hi Michal,
>>>>>>>>>
>>>>>>>>> On 16 February 2016 at 08:17, Michal Simek
>>>>>>>>> <michal.simek at xilinx.com> wrote:
>>>>>>>>>>
>>>>>>>>>> reg-offset is the part of standard 8250 binding in the kernel.
>>>>>>>>>> It is shifting start of address space by reg-offset.
>>>>>>>>>> On Xilinx platform this offset is typically 0x1000.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
>>>>>>>>>> ---
>>>>>>>>>>
>>>>>>>>>>   drivers/serial/ns16550.c | 6 ++++--
>>>>>>>>>>   include/ns16550.h        | 1 +
>>>>>>>>>>   2 files changed, 5 insertions(+), 2 deletions(-)
>>>>>>>>>
>>>>>>>>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>>>>>>>>
>>>>>>>>> Do you support the debug UART feature on your boards?
>>>>>>>>
>>>>>>>> yes. I do support it but there you can put just address plus offset
>>>>>>>> and
>>>>>>>> there is no reason to add one more option to Kconfig.
>>>>>>>> But let me know if you think that this is incorrect flow.
>>>>>>
>>>>>> This patch seems to break my OMAP3 board.  Does anyone know if I need
>>>>>> to set a certain offset for OMAP3 to make this work (and where is the
>>>>>> right place for it) ?
>>>>>
>>>>> Are you using DT init? Check your DT description if there is reg-offset
>>>>> property. I expect if your board worked before and you remove this
>>>>> property it will start to work again.
>>>>>
>>>> I am seeing the same problem with my BeagleBoard Rev. C4. There is
>>>> something common, to more than one board, happening with this commit.
>>>
>>> You should enable debug console and send the log.
>>> Do you have enough space for malloc?
>>>
>> I will have little time this weekend to go further. Some things will
>> need to be un-configured to have enough space. I am around 7 KiB over
>> with DEBUG enabled.
>
>
> I'm not quite sure what exactly is going wrong here - maybe some asm code is
> accessing the fields without proper offset generation?
>
> Either way, the patch below seems to fix the issue for me (on beaglebone):
>
> diff --git a/include/ns16550.h b/include/ns16550.h
> index 5eeacd6..1311f4c 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -54,9 +54,9 @@
>   */
>  struct ns16550_platdata {
>         unsigned long base;
> -       int reg_offset;
>         int reg_shift;
>         int clock;
> +       int reg_offset;
>  };
>
>  struct udevice;
>

I picked up Alexander's suggestion: Still, we should fix everything up
to use member names.

Applied to u-boot-dm/next, thanks!

- Simon


More information about the U-Boot mailing list