All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v1 08/10] sysreset: Add Octeon sysreset driver
Date: Thu, 14 May 2020 10:55:05 +0200	[thread overview]
Message-ID: <04d132c5-1605-922d-7641-100180392e52@denx.de> (raw)
In-Reply-To: <3a1a8ead-d9ae-58d3-8fa3-90d01c55afe8@gmail.com>

On 13.05.20 17:03, Daniel Schwierzeck wrote:
> 
> 
> Am 02.05.20 um 10:59 schrieb Stefan Roese:
>> This patch adds a UCLASS_SYSRESET sysreset driver for the Octeon SoC
>> family.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> ---
>>
>>   drivers/sysreset/Kconfig           |  7 ++++
>>   drivers/sysreset/Makefile          |  1 +
>>   drivers/sysreset/sysreset_octeon.c | 52 ++++++++++++++++++++++++++++++
>>   3 files changed, 60 insertions(+)
>>   create mode 100644 drivers/sysreset/sysreset_octeon.c
>>
>> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
>> index 4be7433404..6ebc90e1d3 100644
>> --- a/drivers/sysreset/Kconfig
>> +++ b/drivers/sysreset/Kconfig
>> @@ -57,6 +57,13 @@ config SYSRESET_MICROBLAZE
>>   	help
>>   	  This is soft reset on Microblaze which does jump to 0x0 address.
>>   
>> +config SYSRESET_OCTEON
>> +	bool "Enable support for Marvell Octeon SoC family"
>> +	depends on ARCH_OCTEON
>> +	help
>> +	  This enables the system reset driver support for Marvell Octeon
>> +	  SoCs.
>> +
>>   config SYSRESET_PSCI
>>   	bool "Enable support for PSCI System Reset"
>>   	depends on ARM_PSCI_FW
>> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
>> index 3ed4bab9e3..df2293b848 100644
>> --- a/drivers/sysreset/Makefile
>> +++ b/drivers/sysreset/Makefile
>> @@ -10,6 +10,7 @@ obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
>>   obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
>>   obj-$(CONFIG_SYSRESET_MPC83XX) += sysreset_mpc83xx.o
>>   obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
>> +obj-$(CONFIG_SYSRESET_OCTEON) += sysreset_octeon.o
>>   obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
>>   obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
>>   obj-$(CONFIG_SYSRESET_SOCFPGA_S10) += sysreset_socfpga_s10.o
>> diff --git a/drivers/sysreset/sysreset_octeon.c b/drivers/sysreset/sysreset_octeon.c
>> new file mode 100644
>> index 0000000000..a05dac3226
>> --- /dev/null
>> +++ b/drivers/sysreset/sysreset_octeon.c
>> @@ -0,0 +1,52 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Copyright (C) 2020 Stefan Roese <sr@denx.de>
>> + */
>> +
>> +#include <common.h>
>> +#include <dm.h>
>> +#include <errno.h>
>> +#include <sysreset.h>
>> +#include <asm/io.h>
>> +
>> +#define RST_SOFT_RST		0x0080
>> +
>> +struct octeon_sysreset_data {
>> +	void __iomem *base;
>> +};
>> +
>> +static int octeon_sysreset_request(struct udevice *dev, enum sysreset_t type)
>> +{
>> +	struct octeon_sysreset_data *data = dev_get_priv(dev);
>> +
>> +	writeq(1, data->base + RST_SOFT_RST);
>> +
>> +	return -EINPROGRESS;
>> +}
>> +
>> +static int octeon_sysreset_probe(struct udevice *dev)
>> +{
>> +	struct octeon_sysreset_data *data = dev_get_priv(dev);
>> +
>> +	data->base = dev_remap_addr(dev);
>> +
>> +	return 0;
>> +}
>> +
>> +static struct sysreset_ops octeon_sysreset = {
>> +	.request = octeon_sysreset_request,
>> +};
>> +
>> +static const struct udevice_id octeon_sysreset_ids[] = {
>> +	{ .compatible = "mrvl,cn7xxx-rst" },
>> +	{ }
>> +};
>> +
>> +U_BOOT_DRIVER(sysreset_octeon) = {
>> +	.id	= UCLASS_SYSRESET,
>> +	.name	= "octeon_sysreset",
>> +	.priv_auto_alloc_size = sizeof(struct octeon_sysreset_data),
>> +	.ops	= &octeon_sysreset,
>> +	.probe	= octeon_sysreset_probe,
>> +	.of_match = octeon_sysreset_ids,
>> +};
>>
> 
> have you planned to add a real reset driver? If you add syscon/regmap
> support to that reset driver, then you could simply use the generic
> sysreset_syscon.c driver.

With a "real reset driver" you are referring to a driver capable of
resetting multiple (all) SoC internal peripherals?

If yes, I thought about adding such a driver. But AFAICT, Octeon does
not support resetting its peripherals via some grouped registers. The
SoC itself can be reset via RST_SOFT_RST register but not its
peripherals.

Thanks,
Stefan

  reply	other threads:[~2020-05-14  8:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02  8:59 [PATCH v1 00/10] mips: Add initial Octeon MIPS64 base support Stefan Roese
2020-05-02  8:59 ` [PATCH v1 01/10] mips: octeon: Initial minimal support for the Marvell Octeon SoC Stefan Roese
2020-05-13 12:49   ` Daniel Schwierzeck
2020-05-14  7:50     ` Stefan Roese
2020-05-13 23:43   ` Daniel Schwierzeck
2020-05-14  9:19     ` Stefan Roese
2020-05-02  8:59 ` [PATCH v1 02/10] mips: cache: Allow using CONFIG_MIPS_L2_CACHE without CONFIG_MIPS_CM Stefan Roese
2020-05-13 12:59   ` Daniel Schwierzeck
2020-05-14  7:57     ` Stefan Roese
2020-05-02  8:59 ` [PATCH v1 03/10] mips: cache: Don't use cache operations with CONFIG_MIPS_CACHE_COHERENT Stefan Roese
2020-05-13 13:05   ` Daniel Schwierzeck
2020-05-14  8:11     ` Stefan Roese
2020-05-02  8:59 ` [PATCH v1 04/10] mips: traps: Set WG bit in EBase register on Octeon Stefan Roese
2020-05-13 13:10   ` Daniel Schwierzeck
2020-05-14  8:21     ` Stefan Roese
2020-05-02  8:59 ` [PATCH v1 05/10] mips: Rename CONFIG_CPU_CAVIUM_OCTEON to CONFIG_CPU_MIPS64_OCTEON Stefan Roese
2020-05-13 13:16   ` Daniel Schwierzeck
2020-05-14  8:36     ` Stefan Roese
2020-05-02  8:59 ` [PATCH v1 06/10] mips: mipsregs.h: Add more register macros for Octeon port Stefan Roese
2020-05-02  8:59 ` [PATCH v1 07/10] mips: mipsregs.h: Sync with linux v5.7.0-rc3 version Stefan Roese
2020-05-02  8:59 ` [PATCH v1 08/10] sysreset: Add Octeon sysreset driver Stefan Roese
2020-05-13 15:03   ` Daniel Schwierzeck
2020-05-14  8:55     ` Stefan Roese [this message]
2020-05-02  8:59 ` [PATCH v1 09/10] mips: octeon: dts: Add Octeon 3 cn73xx base dtsi file Stefan Roese
2020-05-02  8:59 ` [PATCH v1 10/10] mips: octeon: Add minimal Octeon 3 EBB7304 EVK support Stefan Roese
2020-05-13 14:47   ` Daniel Schwierzeck
2020-05-14  8:44     ` Stefan Roese

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=04d132c5-1605-922d-7641-100180392e52@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.