From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Sun, 28 Apr 2013 12:59:20 +0200 Subject: [U-Boot] [PATCH 1/5] vybrid: add vybrid CPU support In-Reply-To: <81BA6E5E0BC2344391CABCEE22D1B6D82FBEFF@039-SN1MPN1-002.039d.mgd.msft.net> References: <1365749635-7025-1-git-send-email-b18965@freescale.com> <1365749635-7025-2-git-send-email-b18965@freescale.com> <5169C0DB.9080707@denx.de> <81BA6E5E0BC2344391CABCEE22D1B6D82FBEFF@039-SN1MPN1-002.039d.mgd.msft.net> Message-ID: <517D0108.5010107@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 On 28/04/2013 12:36, Wang Huan-B18965 wrote: >> >> I would like to understand there common code should be put. As you >> can see, for i.MX there is a imx_common directory that is valid >> across ARM-Core. > [Alison Wang] I'm trying to align the soc with i.mx platform and will > use i.MX's imx_common directory in the next version. But there are > still some issues for sharing the I.MX platform, > > 1. i.mx family uses GPT in timer.c. VF600 doesn't have GPT but a > Periodic Interrupt Timer(PIT) which I think is totally different with > GPT. Too much ifdef in the timer.c seems unacceptable. So I plan to > modify the Makefile and add a pit.c file in imx_common directory for > the timer on this Vybrid platform, How do you think about this idea? > Thanks. We do not need to put everything in imx-common if there is nothing in common. Of course, a new driver is fully acceptable if it support a device that it is not yet mainlined. > 2. The SRC_SRSR register definition on VF600 is different with i.MX. > To reuse the get_reset_cause() function in cpu.c, some platform > related ifdef will be introduced. For example: #ifdef CONFIG_MVF600 > case 0x00080: return "EXTERNAL RESET"; #endif > > Does this kind of ifdef acceptable? Thanks. Only if there are some differences, but most code is shared. We have a get_reset_cause() in imx-common/cpu.c, but also a specific get_reset_cause() for mx25/mx31/mx35. The question can be better answered after you post the code. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================