All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h
@ 2020-07-30  9:28 Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 2/5] ARM: uniphier: remove unused uniphier_pin_init() Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-07-30  9:28 UTC (permalink / raw)
  To: u-boot

Make the include guard match to the file name.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 include/configs/uniphier.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index d0841a7d55f9..1b942cf657db 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -7,8 +7,8 @@
 
 /* U-Boot - Common settings for UniPhier Family */
 
-#ifndef __CONFIG_UNIPHIER_COMMON_H__
-#define __CONFIG_UNIPHIER_COMMON_H__
+#ifndef __CONFIG_UNIPHIER_H__
+#define __CONFIG_UNIPHIER_H__
 
 #ifndef CONFIG_SPL_BUILD
 #include <config_distro_bootcmd.h>
@@ -213,4 +213,4 @@
 
 #define CONFIG_SPL_PAD_TO			0x20000
 
-#endif /* __CONFIG_UNIPHIER_COMMON_H__ */
+#endif /* __CONFIG_UNIPHIER_H__ */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/5] ARM: uniphier: remove unused uniphier_pin_init()
  2020-07-30  9:28 [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h Masahiro Yamada
@ 2020-07-30  9:28 ` Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 3/5] ARM: uniphier: remove unneeded header inclusion from board_late_init.c Masahiro Yamada
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-07-30  9:28 UTC (permalink / raw)
  To: u-boot

This function is unused since commit 862274913f8f ("bus:
uniphier-system-bus: move hardware init from board files").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/Makefile       |  1 -
 arch/arm/mach-uniphier/init.h         |  1 -
 arch/arm/mach-uniphier/pinctrl-glue.c | 30 ---------------------------
 3 files changed, 32 deletions(-)
 delete mode 100644 arch/arm/mach-uniphier/pinctrl-glue.c

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index 38b6d904f466..d333b7091d4b 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -20,7 +20,6 @@ obj-y += reset.o
 endif
 
 obj-$(CONFIG_MICRO_SUPPORT_CARD) += micro-support-card.o
-obj-y += pinctrl-glue.o
 obj-$(CONFIG_MMC) += mmc-first-dev.o
 obj-y += fdt-fixup.o
 
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index dd978c020804..535c06343d81 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -73,7 +73,6 @@ void uniphier_pxs3_clk_init(void);
 unsigned int uniphier_boot_device_raw(void);
 int uniphier_have_internal_stm(void);
 int uniphier_boot_from_backend(void);
-int uniphier_pin_init(const char *pinconfig_name);
 
 #ifdef CONFIG_ARM64
 void uniphier_mem_map_init(unsigned long dram_base, unsigned long dram_size);
diff --git a/arch/arm/mach-uniphier/pinctrl-glue.c b/arch/arm/mach-uniphier/pinctrl-glue.c
deleted file mode 100644
index 2e0726469595..000000000000
--- a/arch/arm/mach-uniphier/pinctrl-glue.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
- */
-
-#include <linux/errno.h>
-#include <dm.h>
-#include <dm/pinctrl.h>
-
-#include "init.h"
-
-int uniphier_pin_init(const char *pinconfig_name)
-{
-	struct udevice *pctldev, *config;
-	int ret;
-
-	ret = uclass_first_device(UCLASS_PINCTRL, &pctldev);
-	if (ret)
-		return ret;
-
-	device_foreach_child(config, pctldev) {
-		if (strcmp(config->name, pinconfig_name))
-			continue;
-
-		return pinctrl_generic_set_state(pctldev, config);
-	}
-
-	return -ENODEV;
-}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/5] ARM: uniphier: remove unneeded header inclusion from board_late_init.c
  2020-07-30  9:28 [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 2/5] ARM: uniphier: remove unused uniphier_pin_init() Masahiro Yamada
@ 2020-07-30  9:28 ` Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 4/5] serial: uniphier: fix typo in comment Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 5/5] ARM: uniphier: use FIELD_GET() to get access to revision register fields Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-07-30  9:28 UTC (permalink / raw)
  To: u-boot

<nand.h> is unneeded since commit 9248a78f40d6 ("ARM: UniPhier: remove
Denali NAND controller fixup code").

<linux/io.h> is uneeded since commit 1320fa2e55d2 ("ARM: uniphier:
remove workaround for the NAND write protect").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/board_late_init.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c
index b800e8b8c6be..8c5e5bb58f65 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -9,9 +9,7 @@
 #include <init.h>
 #include <spl.h>
 #include <linux/libfdt.h>
-#include <nand.h>
 #include <stdio.h>
-#include <linux/io.h>
 #include <linux/printk.h>
 
 #include "init.h"
@@ -53,6 +51,7 @@ fail:
 
 static void uniphier_set_env_addr(const char *env, const char *offset_env)
 {
+	DECLARE_GLOBAL_DATA_PTR;
 	unsigned long offset = 0;
 	const char *str;
 	char *end;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] serial: uniphier: fix typo in comment
  2020-07-30  9:28 [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 2/5] ARM: uniphier: remove unused uniphier_pin_init() Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 3/5] ARM: uniphier: remove unneeded header inclusion from board_late_init.c Masahiro Yamada
@ 2020-07-30  9:28 ` Masahiro Yamada
  2020-07-30  9:28 ` [PATCH 5/5] ARM: uniphier: use FIELD_GET() to get access to revision register fields Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-07-30  9:28 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/serial/serial_uniphier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/serial_uniphier.c b/drivers/serial/serial_uniphier.c
index 4004cb8d48a4..a098028ca001 100644
--- a/drivers/serial/serial_uniphier.c
+++ b/drivers/serial/serial_uniphier.c
@@ -137,7 +137,7 @@ static int uniphier_serial_probe(struct udevice *dev)
 
 	priv->uartclk = clk_data->clk_rate;
 
-	/* flush the trasmitter empty before changing hw setting */
+	/* flush the trasmitter before changing hw setting */
 	while (!(readl(priv->membase + UNIPHIER_UART_LSR) & UART_LSR_TEMT))
 		;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] ARM: uniphier: use FIELD_GET() to get access to revision register fields
  2020-07-30  9:28 [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h Masahiro Yamada
                   ` (2 preceding siblings ...)
  2020-07-30  9:28 ` [PATCH 4/5] serial: uniphier: fix typo in comment Masahiro Yamada
@ 2020-07-30  9:28 ` Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-07-30  9:28 UTC (permalink / raw)
  To: u-boot

Define register fields as macros, and use FIELD_GET().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/sg-regs.h  |  5 +++++
 arch/arm/mach-uniphier/soc-info.c | 21 ++++++++++-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-uniphier/sg-regs.h b/arch/arm/mach-uniphier/sg-regs.h
index f47d10194987..a0fa51a8b7be 100644
--- a/arch/arm/mach-uniphier/sg-regs.h
+++ b/arch/arm/mach-uniphier/sg-regs.h
@@ -10,6 +10,8 @@
 #ifndef UNIPHIER_SG_REGS_H
 #define UNIPHIER_SG_REGS_H
 
+#include <linux/bitops.h>
+
 #ifndef __ASSEMBLY__
 #include <linux/compiler.h>
 #ifdef CONFIG_ARCH_UNIPHIER_V8_MULTI
@@ -24,6 +26,9 @@ extern void __iomem *sg_base;
 
 /* Revision */
 #define SG_REVISION		0x0000
+#define   SG_REVISION_TYPE_MASK		GENMASK(23, 16)
+#define   SG_REVISION_MODEL_MASK	GENMASK(10, 8)
+#define   SG_REVISION_REV_MASK		GENMASK(4, 0)
 
 /* Memory Configuration */
 #define SG_MEMCONF		0x0400
diff --git a/arch/arm/mach-uniphier/soc-info.c b/arch/arm/mach-uniphier/soc-info.c
index f021a8cab330..b0221016d1ef 100644
--- a/arch/arm/mach-uniphier/soc-info.c
+++ b/arch/arm/mach-uniphier/soc-info.c
@@ -4,31 +4,30 @@
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/io.h>
 #include <linux/types.h>
 
 #include "sg-regs.h"
 #include "soc-info.h"
 
-static unsigned int __uniphier_get_revision_field(unsigned int mask,
-						  unsigned int shift)
-{
-	u32 revision = readl(sg_base + SG_REVISION);
-
-	return (revision >> shift) & mask;
-}
-
 unsigned int uniphier_get_soc_id(void)
 {
-	return __uniphier_get_revision_field(0xff, 16);
+	u32 rev = readl(sg_base + SG_REVISION);
+
+	return FIELD_GET(SG_REVISION_TYPE_MASK, rev);
 }
 
 unsigned int uniphier_get_soc_model(void)
 {
-	return __uniphier_get_revision_field(0x7, 8);
+	u32 rev = readl(sg_base + SG_REVISION);
+
+	return FIELD_GET(SG_REVISION_MODEL_MASK, rev);
 }
 
 unsigned int uniphier_get_soc_revision(void)
 {
-	return __uniphier_get_revision_field(0x1f, 0);
+	u32 rev = readl(sg_base + SG_REVISION);
+
+	return FIELD_GET(SG_REVISION_REV_MASK, rev);
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-30  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30  9:28 [PATCH 1/5] ARM: uniphier: rename include guard of include/configs/uniphier.h Masahiro Yamada
2020-07-30  9:28 ` [PATCH 2/5] ARM: uniphier: remove unused uniphier_pin_init() Masahiro Yamada
2020-07-30  9:28 ` [PATCH 3/5] ARM: uniphier: remove unneeded header inclusion from board_late_init.c Masahiro Yamada
2020-07-30  9:28 ` [PATCH 4/5] serial: uniphier: fix typo in comment Masahiro Yamada
2020-07-30  9:28 ` [PATCH 5/5] ARM: uniphier: use FIELD_GET() to get access to revision register fields Masahiro Yamada

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.