mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 7/8] i.MX: serial: Distil common clock ungating code
Date: Mon, 4 May 2015 21:52:20 +0200	[thread overview]
Message-ID: <20150504195220.GS6325@pengutronix.de> (raw)
In-Reply-To: <CAHQ1cqGjdGfVhbLLXf1JeiuTm898uxvMCh7cPXsAphEVfTF6qQ@mail.gmail.com>

On Mon, May 04, 2015 at 11:04:25AM -0700, Andrey Smirnov wrote:
> > Please add a imx6_ namespace to this function. The calling code always
> > knows that it is running on imx6, so you can use IMX6_CCM_BASE_ADDR
> > directly rather than using soc##_. The function above is imx6 specific
> > anyway since only this SoC has the gate registers on 0x68..0x80.
> 
> What about i.MX51? As far as I can tell it is the same as i.MX6 in
> this aspect. This function wouldn't have any consumers on i.MX51
> architecture, of course, but shouldn't this function have a SoC
> variant agnostic name, just for the sake of genericity?

On i.MX1/21/25/27/31/35 the function would look different, so when
trying to create a generic function we would need to decide which SoC
we are on. cpu_is_imxxy() doesn't work at that place because it needs
initialisation. #ifdefs do not work because we may have multiple SoC
supports compiled in. Even if we could decide which SoC we are on,
we still need a cascade of if() or #ifdef. Since the caller already
knows the SoC type it's easiest to create SoC specific functions.

If i.MX51 (and i.MX53 probably aswell) is the same as i.MX6 the i.MX6
function could simply call the i.MX5 function.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-05-04 19:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03  2:26 [RFC, PATCH] i.MX: Add provisions to boot from IRAM Andrey Smirnov
2015-05-03  2:26 ` [PATCH 1/8] i.MX: Move UART definitions into a separate file Andrey Smirnov
2015-05-04  7:08   ` Sascha Hauer
2015-05-03  2:26 ` [PATCH 2/8] i.MX: serial: Add constants for UART clock divisor Andrey Smirnov
2015-05-03  2:26 ` [PATCH 3/8] i.MX: serial: Add baud rate calculation convenience functions Andrey Smirnov
2015-05-03  2:26 ` [PATCH 4/8] i.MX51: babbage: Implement CONFIG_DEBUG_LL Andrey Smirnov
2015-05-04  6:43   ` Sascha Hauer
2015-05-03  2:26 ` [PATCH 5/8] i.MX: serial: Add setup_uart_ll function Andrey Smirnov
2015-05-04  6:53   ` Sascha Hauer
2015-05-03  2:26 ` [PATCH 6/8] i.MX: serial: Convert i.MX51 and i.MX6 to use 'setup_uart_ll' Andrey Smirnov
2015-05-04  6:57   ` Sascha Hauer
2015-05-03  2:26 ` [PATCH 7/8] i.MX: serial: Distil common clock ungating code Andrey Smirnov
2015-05-04  7:01   ` Sascha Hauer
2015-05-04 18:04     ` Andrey Smirnov
2015-05-04 19:52       ` Sascha Hauer [this message]
2015-05-03  2:26 ` [PATCH 8/8] Makefile.lib: Make 'check_file_size' more flexible Andrey Smirnov
2015-05-04  7:14 ` [RFC, PATCH] i.MX: Add provisions to boot from IRAM Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150504195220.GS6325@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox