From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/6] ARM: EXYNOS: Refactoring to remove soc_is_exynos macros from exynos
Date: Tue, 10 Jun 2014 16:46:06 +0200 [thread overview]
Message-ID: <53971A2E.2010104@samsung.com> (raw)
In-Reply-To: <1399706419-13976-7-git-send-email-pankaj.dubey@samsung.com>
Hi Pankaj,
On 10.05.2014 09:20, Pankaj Dubey wrote:
> This patch enables chipid driver for ARCH_EXYNOS and refactors
> machine code as well as exynos cpufreq driver code for using
> chipid driver for identification of SoC ID and SoC rev.
>
> This patch also updates DT binding information in exynos4 and
> exynos5 dtsi file. As to differentiate product id bit-mask we need
> separate compatible string for exynos4 and exynos5. Hoping this will
> be helpful in future as bit-mask and bit-shift bit may differ.
> Added binding information as well.
[snip]
> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
> index d0482c2..9d6ec84 100644
> --- a/arch/arm/mach-exynos/platsmp.c
> +++ b/arch/arm/mach-exynos/platsmp.c
> @@ -20,13 +20,13 @@
> #include <linux/smp.h>
> #include <linux/io.h>
> #include <linux/of_address.h>
> +#include <linux/exynos-soc.h>
>
> #include <asm/cacheflush.h>
> #include <asm/smp_plat.h>
> #include <asm/smp_scu.h>
> #include <asm/firmware.h>
>
> -#include <plat/cpu.h>
> #include <mach/map.h>
>
> #include "common.h"
> @@ -59,7 +59,8 @@ static void __init exynos_smp_prepare_sram(void)
>
> static inline void __iomem *cpu_boot_reg_base(void)
> {
> - if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
> + if (is_soc_id_compatible(EXYNOS4210) &&
> + is_soc_rev_compatible(EXYNOS4210_REV_1_1))
Well, how is this any better than what is already there? When adding a
new SoC, you will likely have to add another series of "||"s or "&&"s
with specific SoC IDs, when using this kind of API. This is not the point.
For now, all those things can be replaced simply with
of_machine_is_compatible() (except checks for samsung_rev()), but in the
end they need to be properly abstracted. The goal is to be able to add
support for new SoC, which requires identical steps to perform certain
things as already supported SoCs, without explicitly stating this in
driver code.
E.g. Exynos5250 is already supported, while Exynos5251 shows up. Let's
say it has exactly the same secondary CPU boot-up method as Exynos5250,
but to enter suspend mode, the same steps as on Exynos5260 have to be
performed. With any kind of per-SoC check API, you will have to add
soc_is_exynos5251() or is_soc_id_compatible(EXYNOS5251) in CPU bring-up
code and low-level suspend code, even though all the functional code is
already there.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-06-10 14:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1399706287-13919-1-git-send-email-y@samsung.com>
2014-05-10 7:20 ` [PATCH v3 0/6] Introducing Exynos ChipId driver Pankaj Dubey
2014-05-10 7:20 ` [PATCH v3 1/6] i2c: s3c2410: Handle i2c sys_cfg register in i2c driver Pankaj Dubey
2014-06-02 17:14 ` Wolfram Sang
2014-06-10 13:35 ` Tomasz Figa
2014-06-17 4:21 ` Pankaj Dubey
2014-05-10 7:20 ` [PATCH v3 2/6] ARM: EXYNOS: Remove i2c sys configuration related code Pankaj Dubey
2014-06-10 13:52 ` Tomasz Figa
2014-05-10 7:20 ` [PATCH v3 3/6] ARM: EXYNOS: Remove soc_is_exynos4/5 from exynos.c Pankaj Dubey
2014-06-10 13:55 ` Tomasz Figa
2014-06-10 14:04 ` Arnd Bergmann
2014-05-10 7:20 ` [PATCH v3 4/6] ARM: EXYNOS: Remove unused header inclusion from hotplug.c Pankaj Dubey
2014-06-10 13:56 ` Tomasz Figa
2014-06-17 3:52 ` Pankaj Dubey
2014-05-10 7:20 ` [PATCH v3 5/6] soc: samsung: exynos-chipid: Add Exynos Chipid driver support Pankaj Dubey
2014-06-10 14:36 ` Tomasz Figa
2014-05-10 7:20 ` [PATCH v3 6/6] ARM: EXYNOS: Refactoring to remove soc_is_exynos macros from exynos Pankaj Dubey
2014-06-10 14:46 ` Tomasz Figa [this message]
[not found] ` <1399706287-13919-4-git-send-email-y@samsung.com>
2014-05-11 6:52 ` [PATCH v3 3/6] ARM: EXYNOS: Remove soc_is_exynos4/5 from exynos.c Olof Johansson
2014-05-12 2:22 ` Pankaj Dubey
[not found] ` <1399706287-13919-7-git-send-email-y@samsung.com>
2014-05-11 7:10 ` [PATCH v3 6/6] ARM: EXYNOS: Refactoring to remove soc_is_exynos macros from exynos Olof Johansson
2014-05-12 2:13 ` Pankaj Dubey
2014-05-11 7:12 ` [PATCH v3 0/6] Introducing Exynos ChipId driver Olof Johansson
2014-05-12 1:52 ` Pankaj Dubey
2014-05-12 1:51 ` Olof Johansson
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=53971A2E.2010104@samsung.com \
--to=t.figa@samsung.com \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).