mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	linux-arm-kernel@lists.infradead.org
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Brand <chris.brand@broadcom.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Jayachandran C <jchandra@broadcom.com>,
	Juri Lelli <juri.lelli@arm.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 2/5] arm: mvebu: support for SMP on 98DX3336 SoC
Date: Wed, 4 Jan 2017 20:04:16 -0800	[thread overview]
Message-ID: <5edb6751-d15b-6654-f4ae-adf38fafb8a4@gmail.com> (raw)
In-Reply-To: <20170105033641.6212-3-chris.packham@alliedtelesis.co.nz>

Le 01/04/17 à 19:36, Chris Packham a écrit :
> Compared to the armada-xp the 98DX3336 uses different registers to set
> the boot address for the secondary CPU so a new enable-method is needed.
> This will only work if the machine definition doesn't define an overall
> smp_ops because there is not currently a way of overriding this from the
> device tree if it is set in the machine definition.

Not sure I follow you here, in theory, each individual CPU could have a
different enable-method property, and considering how you leverage
existing DTS include files, you should be able to override the DTS with
the appropriate enable-method, or do you have a different problem?

 mv98dx3236_resume_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
> +{
> +	WARN_ON(hw_cpu != 1);
> +
> +	writel(0, mv98dx3236_resume_base + MV98DX3236_CPU_RESUME_CTRL_OFFSET);
> +	writel(virt_to_phys(boot_addr), mv98dx3236_resume_base +
> +	       MV98DX3236_CPU_RESUME_ADDR_OFFSET);

I just submitted a patch series that switches such users to
__pa_symbol() instead of virt_to_phys() because this is a kernel image
symbol. For now this will work as-is, but depending on which patch
series makes it first, it may be a good idea to keep this on someone's
TODO list (yours or mine). I do expect having to make a second pass of
conversions anyway.

[1]: https://lkml.org/lkml/2017/1/4/1101

> +}
> +
> +static int __init mv98dx3236_resume_init(void)
> +{
> +	struct device_node *np;
> +	struct resource res;
> +	int ret = 0;
> +
> +	np = of_find_matching_node(NULL, of_mv98dx3236_resume_table);
> +	if (!np)
> +		return 0;
> +
> +	pr_info("Initializing 98DX3236 Resume\n");

This can be probably be dropped, you should know fairly quickly if this
succeeded or not.

Can't this function be implemented as a smp_ops::smp_init_cpus instead
of having this initialization done at arch_initcall time?

> +
> +	if (of_address_to_resource(np, 0, &res)) {
> +		pr_err("unable to get resource\n");
> +		ret = -ENOENT;
> +		goto out;
> +	}
> +
> +	if (!request_mem_region(res.start, resource_size(&res),
> +				np->full_name)) {
> +		pr_err("unable to request region\n");
> +		ret = -EBUSY;
> +		goto out;
> +	}

You should be able to use of_io_request_and_map() and here.
-- 
Florian

  reply	other threads:[~2017-01-05  4:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05  3:36 [PATCHv2 0/5] Support for Marvell switches with integrated CPUs Chris Packham
2017-01-05  3:36 ` [PATCHv2 1/5] clk: mvebu: support for 98DX3236 SoC Chris Packham
2017-01-05 13:53   ` Mark Rutland
2017-01-05 23:05     ` Chris Packham
2017-01-05  3:36 ` [PATCHv2 2/5] arm: mvebu: support for SMP on 98DX3336 SoC Chris Packham
2017-01-05  4:04   ` Florian Fainelli [this message]
2017-01-05  4:46     ` Chris Packham
2017-01-05 20:49       ` Chris Packham
2017-01-05  3:36 ` [PATCHv2 3/5] pinctrl: mvebu: pinctrl driver for 98DX3236 SoC Chris Packham
2017-01-05  3:36 ` [PATCHv2 4/5] arm: mvebu: Add device tree for 98DX3236 SoCs Chris Packham
2017-01-05  4:06   ` Florian Fainelli
2017-01-05  4:34     ` Chris Packham
2017-01-05 13:58   ` Mark Rutland
2017-01-05 20:10     ` Chris Packham
2017-01-05  3:36 ` [PATCHv2 5/5] arm: mvebu: Add device tree for db-dxbc2 and db-xc3-24g4xg boards Chris Packham
2017-01-05  4:07 ` [PATCHv2 0/5] Support for Marvell switches with integrated CPUs Florian Fainelli
2017-01-05  4:24   ` Chris Packham
2017-01-05 13:09     ` Andrew Lunn
2017-01-05 14:07       ` Marcin Wojtas
2017-01-05 19:46       ` Chris Packham
2017-01-05 19:52         ` Florian Fainelli
2017-01-05 14:09 ` Marcin Wojtas
2017-01-05 20:02   ` Chris Packham
2017-01-06  4:14 ` Chris Packham
2017-01-06  4:14   ` [PATCHv3 1/5] clk: mvebu: support for 98DX3236 SoC Chris Packham
2017-01-09 18:39     ` Rob Herring
2017-01-06  4:14   ` [PATCHv3 2/5] arm: mvebu: support for SMP on 98DX3336 SoC Chris Packham
2017-01-06  6:36     ` Stephen Boyd
2017-01-06  8:41       ` Chris Packham
2017-01-09 18:40     ` Rob Herring
2017-01-06  4:15   ` [PATCHv3 3/5] pinctrl: mvebu: pinctrl driver for 98DX3236 SoC Chris Packham
2017-01-09 18:41     ` Rob Herring
2017-01-11 14:44     ` Linus Walleij
2017-01-11 20:55       ` Sebastian Hesselbarth
2017-01-12  9:13         ` Chris Packham
2017-01-06  4:15   ` [PATCHv3 4/5] arm: mvebu: Add device tree for 98DX3236 SoCs Chris Packham
2017-01-09 18:44     ` Rob Herring
2017-01-26 15:09     ` Gregory CLEMENT
2017-01-26 20:07       ` Chris Packham
2017-01-26 20:24       ` Chris Packham
2017-01-26 22:52         ` Chris Packham
2017-01-06  4:15   ` [PATCHv3 5/5] arm: mvebu: Add device tree for db-dxbc2 and db-xc3-24g4xg boards Chris Packham
2017-01-26 15:12     ` Gregory CLEMENT

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=5edb6751-d15b-6654-f4ae-adf38fafb8a4@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=chris.brand@broadcom.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=jchandra@broadcom.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=sudeep.holla@arm.com \
    /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

all inboxes | Powered by JetHome®