[U-Boot] [PATCH] serial: ns16550: fix different reg size access

Lei Wen adrian.wenl at gmail.com
Fri Apr 1 15:07:29 CEST 2011


On Fri, Apr 1, 2011 at 8:41 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Lei Wen,
>
> In message <AANLkTikiH8FUKprdHOuWNe8su0fTN_HcawsZB9xehMaT at mail.gmail.com> you wrote:
>>
>> I think my code also could handle this. They only could set the
>> CONFIG_SYS_NS16550_REG_SIZE  to be 1
>> and CONFIG_SYS_NS16550_MAX_REG_SIZE to be 4. Then
>> the other bits is untouched by this driver.
>
> I don't think so. You still use just a single writel() call then.  To
> leave the other bits untouched, you would have to perform a readl()
> first, then insert one data byte, and then write it back.  Your patch
> does not do that.

My original patch is like below, so where it call writel?...
+#elif (CONFIG_SYS_NS16550_REG_SIZE == 1) || (CONFIG_SYS_NS16550_REG_SIZE == -1)
+#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
+#define serial_out(x, y)       outb(x, y)
+#define serial_in(y)           inb(y)
+#else
+#define serial_out(x, y)       writeb(x, y)
+#define serial_in(y)           readb(y)

Best regards,
Lei


More information about the U-Boot mailing list