From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 01 Apr 2011 21:04:41 +0200 Subject: [U-Boot] [PATCH] serial: ns16550: fix different reg size access In-Reply-To: References: Message-ID: <20110401190442.05D41142E074@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Prafulla Wadaskar, In message you wrote: > > 1. ns16550 is standard IP used across several SoC and has driver in place. > 2. Your specific implementation of the same IP on your specific SoC need > bit9 or x register to be set to 0 to work this IP correctly on your h/w. > 3. but doing in ns16550 driver may brake other implementations. Right. > (correct me if I am wrong) > > So what I suggest here- > 1. do not disturb/touch nx16550 driver at all. > 2. write a small init code in cpu.c (specific to this SoC/arch) to reset this bit only. Sorry, but I dislike this approach. I think it would be better to provide a proper driver infrastructure for this type of UART, as it might be used in other appliances, and it is a good idea to keep all related code parts together in one driver file. Here is what I suggested (I think I repeat it the 3rd time now): | 2) If you have additional, non-standard bits in your device, you must | initialize these separately. Eventually you provide a custom | driver which just calls the standard NS16550 driver functions, | except where you have additional need to manipulate the extra, | non-standard bits of your device. Thanks. Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de About the use of language: it is impossible to sharpen a pencil with a blunt ax. It is equally vain to try to do it with ten blunt axes instead. -- Edsger Dijkstra