
On Fri, Apr 1, 2011 at 8:41 PM, Wolfgang Denk wd@denx.de wrote:
Dear Lei Wen,
In message AANLkTikiH8FUKprdHOuWNe8su0fTN_HcawsZB9xehMaT@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