Skip to contentSkip to conversation

Add support for Panasonic UniPhier SoCs/boards

PATCH Superseded Masahiro Yamada 6 participants 26 messages Sep 5, 2014 – Sep 22, 2014

Subsystems (5)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add support for Panasonic UniPhier SoCs/boards

UniPhier is the SoC family developed by Panasonic Corporation, based on ARM Cortex-A9.

This patch set adds its SoC/board support code with some drivers.

I confirmed this series can be applied onto v2014.10-rc2 tag and built cleanly.

Changes between v3 and v4
-------------------------

Disable Denali NAND Driver.
The version 3 depended on Chin Liang See's patch:
http://patchwork.ozlabs.org/patch/381305/

This driver is a nightmare.
Almost 9 months have passed since v1 was posted.
It is still unapplicable and we are expecting v10
but no response from him so far.
I have no idea when we can get it in.

I am too tired and getting sick of it.
I can't wait any more.

V4 drops the dependency on his patch.
I will enable it again when it is merged into the mainline.

Masahiro Yamada (6):
nand: denali: add Denali NAND driver for SPL
serial: add UniPhier serial driver
arm: uniphier: add UniPhier SoC support code
arm: uniphier: add Kconfig and defconfig
MAINTAINERS: add me as a maintainer of UniPhier platform
git-mailrc: add me as a maintainer of UniPhier platform

 MAINTAINERS                                        |    8 +
 arch/arm/Kconfig                                   |    5 +
 arch/arm/cpu/armv7/uniphier/Kconfig                |   32 +
 arch/arm/cpu/armv7/uniphier/Makefile               |   23 +
 arch/arm/cpu/armv7/uniphier/board_common.c         |   32 +
 arch/arm/cpu/armv7/uniphier/board_late_init.c      |   82 ++
 arch/arm/cpu/armv7/uniphier/cache_uniphier.c       |  154 +++
 arch/arm/cpu/armv7/uniphier/cmd_pinmon.c           |   33 +
 arch/arm/cpu/armv7/uniphier/cpu_info.c             |   59 ++
 arch/arm/cpu/armv7/uniphier/dram_init.c            |   37 +
 arch/arm/cpu/armv7/uniphier/init_page_table.c      | 1068 ++++++++++++++++++++
 arch/arm/cpu/armv7/uniphier/lowlevel_init.S        |  159 +++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile       |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c     |   33 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c   |   16 +
 .../armv7/uniphier/ph1-ld4/board_postclk_init.c    |   42 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c    |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c  |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c      |   63 ++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c     |  189 ++++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c     |   44 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c      |   28 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c     |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile      |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c  |   16 +
 .../armv7/uniphier/ph1-pro4/board_postclk_init.c   |   39 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c   |   66 ++
 arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c     |   45 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c    |  168 +++
 .../arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c |   18 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c    |   75 ++
 arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c     |   28 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c    |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile      |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c    |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c  |   16 +
 .../armv7/uniphier/ph1-sld8/board_postclk_init.c   |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c   |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c     |   57 ++
 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c    |  201 ++++
 .../arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c    |   51 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c     |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c    |   10 +
 arch/arm/cpu/armv7/uniphier/reset.c                |   29 +
 arch/arm/cpu/armv7/uniphier/smp.S                  |   54 +
 arch/arm/cpu/armv7/uniphier/spl.c                  |   17 +
 arch/arm/cpu/armv7/uniphier/support_card.c         |  180 ++++
 arch/arm/cpu/armv7/uniphier/timer.c                |   39 +
 arch/arm/include/asm/arch-uniphier/arm-mpcore.h    |   46 +
 arch/arm/include/asm/arch-uniphier/bcu-regs.h      |   29 +
 arch/arm/include/asm/arch-uniphier/board.h         |   35 +
 arch/arm/include/asm/arch-uniphier/boot-device.h   |   20 +
 arch/arm/include/asm/arch-uniphier/led.h           |  101 ++
 arch/arm/include/asm/arch-uniphier/sbc-regs.h      |  107 ++
 arch/arm/include/asm/arch-uniphier/sc-regs.h       |   62 ++
 arch/arm/include/asm/arch-uniphier/sg-regs.h       |  182 ++++
 arch/arm/include/asm/arch-uniphier/ssc-regs.h      |   65 ++
 configs/ph1_ld4_defconfig                          |    4 +
 configs/ph1_pro4_defconfig                         |    4 +
 configs/ph1_sld8_defconfig                         |    4 +
 doc/git-mailrc                                     |    1 +
 drivers/mtd/nand/Makefile                          |    1 +
 drivers/mtd/nand/denali_spl.c                      |  245 +++++
 drivers/serial/Makefile                            |    1 +
 drivers/serial/serial.c                            |    2 +
 drivers/serial/serial_uniphier.c                   |  204 ++++
 include/configs/ph1_ld4.h                          |   59 ++
 include/configs/ph1_pro4.h                         |   61 ++
 include/configs/ph1_sld8.h                         |   59 ++
 include/configs/uniphier-common.h                  |  279 +++++
 74 files changed, 4931 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/uniphier/Kconfig
 create mode 100644 arch/arm/cpu/armv7/uniphier/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/board_common.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/board_late_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cache_uniphier.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cmd_pinmon.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cpu_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/dram_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/init_page_table.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/reset.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/smp.S
 create mode 100644 arch/arm/cpu/armv7/uniphier/spl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/support_card.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/timer.c
 create mode 100644 arch/arm/include/asm/arch-uniphier/arm-mpcore.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/bcu-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/board.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/boot-device.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/led.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sbc-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sc-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sg-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/ssc-regs.h
 create mode 100644 configs/ph1_ld4_defconfig
 create mode 100644 configs/ph1_pro4_defconfig
 create mode 100644 configs/ph1_sld8_defconfig
 create mode 100644 drivers/mtd/nand/denali_spl.c
 create mode 100644 drivers/serial/serial_uniphier.c
 create mode 100644 include/configs/ph1_ld4.h
 create mode 100644 include/configs/ph1_pro4.h
 create mode 100644 include/configs/ph1_sld8.h
 create mode 100644 include/configs/uniphier-common.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

The SPL-mode driver for Denali(Cadence) NAND Flash Memory Controller IP.

This driver requires two CONFIG macros:
- CONFIG_SPL_NAND_DENALI
Define to enable this driver.
- CONFIG_SYS_NAND_BAD_BLOCK_POS
Specify bad block mark position in the oob space. Typically 0.

Cc Chin Liang See <[email protected]>
Cc Scott Wood <[email protected]>

---

Changes in v4:
- Add a workaround to not depend on the Denali driver posted by Chin Liang See.
This driver has been taking too long:
http://patchwork.ozlabs.org/patch/381305/

Changes in v3: None
Changes in v2:
- Avoid unaligned access
- Replace a magic number 0x2000 with PIPELINE_ACCESS

 drivers/mtd/nand/Makefile     |   1 +
 drivers/mtd/nand/denali_spl.c | 245 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 246 insertions(+)
 create mode 100644 drivers/mtd/nand/denali_spl.c
drivers/mtd/nand/Makefile +1 -0
index bf1312a..f90f9a0 100644
@@ -12,6 +12,7 @@ NORMAL_DRIVERS=y
 endif
 
 obj-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o
+obj-$(CONFIG_SPL_NAND_DENALI) += denali_spl.o
 obj-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o
 obj-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o
 obj-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
drivers/mtd/nand/denali_spl.c new file +245 -0

245 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

Hi Masahiro,

Quoted 11 lines · Masahiro Yamada

The SPL-mode driver for Denali(Cadence) NAND Flash Memory Controller IP.

This driver requires two CONFIG macros:
- CONFIG_SPL_NAND_DENALI
Define to enable this driver.
- CONFIG_SYS_NAND_BAD_BLOCK_POS
Specify bad block mark position in the oob space. Typically 0.

Cc Chin Liang See <[email protected]>
Cc Scott Wood <[email protected]>
Quoted 8 lines

---

Changes in v4:
- Add a workaround to not depend on the Denali driver posted by Chin Liang See.
This driver has been taking too long:
http://patchwork.ozlabs.org/patch/381305/

Yup, hopefully v10 would be the final patch.

Quoted 202 lines

Changes in v3: None
Changes in v2:
- Avoid unaligned access
- Replace a magic number 0x2000 with PIPELINE_ACCESS

 drivers/mtd/nand/Makefile     |   1 +
 drivers/mtd/nand/denali_spl.c | 245 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 246 insertions(+)
 create mode 100644 drivers/mtd/nand/denali_spl.c
drivers/mtd/nand/Makefile +1 -0
index bf1312a..f90f9a0 100644
@@ -12,6 +12,7 @@ NORMAL_DRIVERS=y
 endif
 
 obj-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o
+obj-$(CONFIG_SPL_NAND_DENALI) += denali_spl.o
 obj-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o
 obj-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o
 obj-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
drivers/mtd/nand/denali_spl.c new file +174 -0
new file mode 100644
index 0000000..ab23743
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2014       Panasonic Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/unaligned.h>
+#include <linux/mtd/nand.h>
+#if 0
+#include "denali.h"
+#else
+/* workaround until denali.h is merged */
+#define TRANSFER_SPARE_REG			0x10
+#define ECC_ENABLE				0xe0
+#define PAGES_PER_BLOCK				0x150
+#define DEVICE_MAIN_AREA_SIZE			0x170
+#define DEVICE_SPARE_AREA_SIZE			0x180
+
+#define INTR_STATUS(__bank)	(0x410 + ((__bank) * 0x50))
+#define     INTR_STATUS__ECC_UNCOR_ERR			0x0001
+#define     INTR_STATUS__LOAD_COMP			0x0040
+
+#define INDEX_CTRL_REG    0x0
+#define INDEX_DATA_REG    0x10
+#define MODE_01    0x04000000
+#define MODE_10    0x08000000
+#endif
+
+#define SPARE_ACCESS		0x41
+#define MAIN_ACCESS		0x42
+#define PIPELINE_ACCESS		0x2000
+
+#define BANK(x) ((x) << 24)
+
+static void __iomem *denali_flash_mem =
+			(void __iomem *)CONFIG_SYS_NAND_DATA_BASE;
+static void __iomem *denali_flash_reg =
+			(void __iomem *)CONFIG_SYS_NAND_REGS_BASE;
+
+static const int flash_bank;
+static uint8_t page_buffer[NAND_MAX_PAGESIZE];
+static int page_size, oob_size, pages_per_block;
+
+static void index_addr(uint32_t address, uint32_t data)
+{
+	writel(address, denali_flash_mem + INDEX_CTRL_REG);
+	writel(data, denali_flash_mem + INDEX_DATA_REG);
+}
+
+static int wait_for_irq(uint32_t irq_mask)
+{
+	unsigned long timeout = 1000000;
+	uint32_t intr_status;
+
+	do {
+		intr_status = readl(denali_flash_reg + INTR_STATUS(flash_bank));
+
+		if (intr_status & INTR_STATUS__ECC_UNCOR_ERR) {
+			debug("Uncorrected ECC detected\n");
+			return -EIO;
+		}
+
+		if (intr_status & irq_mask)
+			break;
+
+		udelay(1);
+		timeout--;
+	} while (timeout);
+
+	if (!timeout) {
+		debug("Timeout with interrupt status %08x\n", intr_status);
+		return -EIO;
+	}
+
+	return 0;
+}
+
+static void read_data_from_flash_mem(uint8_t *buf, int len)
+{
+	int i;
+	uint32_t *buf32;
+
+	/* transfer the data from the flash */
+	buf32 = (uint32_t *)buf;
+
+	/*
+	 * Let's take care of unaligned access although it rarely happens.
+	 * Avoid put_unaligned() for the normal use cases since it leads to
+	 * a bit performance regression.
+	 */
+	if ((unsigned long)buf32 % 4) {
+		for (i = 0; i < len / 4; i++)
+			put_unaligned(readl(denali_flash_mem + INDEX_DATA_REG),
+				      buf32++);
+	} else {
+		for (i = 0; i < len / 4; i++)
+			*buf32++ = readl(denali_flash_mem + INDEX_DATA_REG);
+	}
+
+	if (len % 4) {
+		u32 tmp;
+
+		tmp = cpu_to_le32(readl(denali_flash_mem + INDEX_DATA_REG));
+		buf = (uint8_t *)buf32;
+		for (i = 0; i < len % 4; i++) {
+			*buf++ = tmp;
+			tmp >>= 8;
+		}
+	}
+}
+
+int denali_send_pipeline_cmd(int page, int ecc_en, int access_type)
+{
+	uint32_t addr, cmd;
+	static uint32_t page_count = 1;
+
+	writel(ecc_en, denali_flash_reg + ECC_ENABLE);
+
+	/* clear all bits of intr_status. */
+	writel(0xffff, denali_flash_reg + INTR_STATUS(flash_bank));
+
+	addr = BANK(flash_bank) | page;
+
+	/* setup the acccess type */
+	cmd = MODE_10 | addr;
+	index_addr(cmd, access_type);
+
+	/* setup the pipeline command */
+	index_addr(cmd, PIPELINE_ACCESS | page_count);
+
+	cmd = MODE_01 | addr;
+	writel(cmd, denali_flash_mem + INDEX_CTRL_REG);
+
+	return wait_for_irq(INTR_STATUS__LOAD_COMP);
+}
+
+static int nand_read_oob(void *buf, int page)
+{
+	int ret;
+
+	ret = denali_send_pipeline_cmd(page, 0, SPARE_ACCESS);
+	if (ret < 0)
+		return ret;
+
+	read_data_from_flash_mem(buf, oob_size);
+
+	return 0;
+}
+
+static int nand_read_page(void *buf, int page)
+{
+	int ret;
+
+	ret = denali_send_pipeline_cmd(page, 1, MAIN_ACCESS);
+	if (ret < 0)
+		return ret;
+
+	read_data_from_flash_mem(buf, page_size);
+
+	return 0;
+}
+
+static int nand_block_isbad(int block)
+{
+	int ret;
+
+	ret = nand_read_oob(page_buffer, block * pages_per_block);
+	if (ret < 0)
+		return ret;
+
+	return page_buffer[CONFIG_SYS_NAND_BAD_BLOCK_POS] != 0xff;
+}

drivers/mtd/nand/denali_spl.c line 184

Quoted 10 lines
drivers/mtd/nand/denali_spl.c new file +10 -0
+
+/* nand_init() - initialize data to make nand usable by SPL */
+void nand_init(void)
+{
+	/* access to main area */
+	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
+
+	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
+	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
+	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);

I believe this will work for ONFI NAND devices only. For non-ONFI, the value might not correct.

Quoted 5 lines
drivers/mtd/nand/denali_spl.c new file +5 -0
+}
+
+int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
+{
+	int block, page, column, readlen;

drivers/mtd/nand/denali_spl.c line 199

Quoted 10 lines
drivers/mtd/nand/denali_spl.c new file +10 -0
+	int ret;
+	int force_bad_block_check = 1;
+
+	page = offs / page_size;
+	column = offs % page_size;
+
+	block = page / pages_per_block;
+	page = page % pages_per_block;
+
+	while (size) {

I believe we need to error out when reading beyond last block.

drivers/mtd/nand/denali_spl.c line 211

Quoted 12 lines
drivers/mtd/nand/denali_spl.c new file +12 -0
+		if (force_bad_block_check || page == 0) {
+			ret = nand_block_isbad(block);
+			if (ret < 0)
+				return ret;
+
+			if (ret) {
+				block++;
+				continue;
+			}
+		}
+
+		force_bad_block_check = 0;

I believe we still need to check the subsequent block whether is bad or not too. This can be enable when cross the block boundary.

Quoted 24 lines
drivers/mtd/nand/denali_spl.c new file +24 -0
+
+		if (unlikely(column || size < page_size)) {
+			/* Partial page read */
+			ret = nand_read_page(page_buffer,
+					     block * pages_per_block + page);
+			if (ret < 0)
+				return ret;
+
+			readlen = min(page_size - column, size);
+			memcpy(dst, page_buffer, readlen);
+
+			column = 0;
+		} else {
+			ret = nand_read_page(dst,
+					     block * pages_per_block + page);
+			if (ret < 0)
+				return ret;
+
+			readlen = page_size;
+		}
+
+		size -= readlen;
+		dst += readlen;
+		page++;

drivers/mtd/nand/denali_spl.c line 245

Quoted 10 lines
drivers/mtd/nand/denali_spl.c new file +10 -0
+		if (page == pages_per_block) {
+			block++;
+			page = 0;
+		}
+	}
+
+	return 0;
+}
+
+void nand_deselect(void) {}

Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling the SPL NAND image load. Wonder this driver will be integrated into nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?

Thanks
Chin Liang

#3 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

Hi.

Quoted 8 lines
Quoted 6 lines

Changes in v4:
- Add a workaround to not depend on the Denali driver posted by Chin Liang See.
This driver has been taking too long:
http://patchwork.ozlabs.org/patch/381305/

Yup, hopefully v10 would be the final patch.

I hope so.

Quoted 16 lines
Quoted 16 lines
drivers/mtd/nand/denali_spl.c new file +16 -0
+static int nand_block_isbad(int block)
+{
+	int ret;
+
+	ret = nand_read_oob(page_buffer, block * pages_per_block);
+	if (ret < 0)
+		return ret;
+
+	return page_buffer[CONFIG_SYS_NAND_BAD_BLOCK_POS] != 0xff;
+}
+
+/* nand_init() - initialize data to make nand usable by SPL */
+void nand_init(void)
+{
+	/* access to main area */
+	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 184

Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +4 -0
+
+	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
+	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
+	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);

I believe this will work for ONFI NAND devices only. For non-ONFI, the value might not correct.

I don't think so.
It depends on the hardware; in my understanding
Denali IP is capable of detecting MAIN_AREA_SIZE etc.
for non-ONFI devices. At least this is working with non-ONFI devices on some Panasonic boards.

If it does not work for Altera SoCs (and if you are planning to use this driver), these three registers should be set in advance in an earlier board init.

Quoted 9 lines
Quoted 9 lines
drivers/mtd/nand/denali_spl.c new file +9 -0
+}
+
+int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
+{
+	int block, page, column, readlen;
+	int ret;
+	int force_bad_block_check = 1;
+
+	page = offs / page_size;
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 199

Quoted 6 lines
drivers/mtd/nand/denali_spl.c new file +6 -0
+	column = offs % page_size;
+
+	block = page / pages_per_block;
+	page = page % pages_per_block;
+
+	while (size) {

I believe we need to error out when reading beyond last block.

How do you know the number of blocks of non-ONFI devices? Scan nand_ids.c for SPL?

Quoted 17 lines
Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +2 -0
+		if (force_bad_block_check || page == 0) {
+			ret = nand_block_isbad(block);

drivers/mtd/nand/denali_spl.c line 211

Quoted 10 lines
drivers/mtd/nand/denali_spl.c new file +10 -0
+			if (ret < 0)
+				return ret;
+
+			if (ret) {
+				block++;
+				continue;
+			}
+		}
+
+		force_bad_block_check = 0;

I believe we still need to check the subsequent block whether is bad or not too. This can be enable when cross the block boundary.

I am afraid you are misunderstanding my code.

This function does bad block checking for every block.

Here,

		if (force_bad_block_check || page == 0) {
			ret = nand_block_isbad(block);

"page == 0" means the beginning of each block.

Quoted 5 lines

Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling the SPL NAND image load. Wonder this driver will be integrated into nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?

I am not planning to do so because:

[1] nand_spl_simple.c requires CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_PAGE_COUNT; we need to specify the device attributes at compilation, which the Denali IP is able to detect at run time.
It is not acceptable for us because we need (want) the run time configuration.

[2] nand_spl_simple.c is so generic that it cannot use the hardware acceleration of the Denali IP, that is, slower booting.

Best Regards
Masahiro Yamada

#4 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

Hi Masahiro,

Quoted 21 lines · Masahiro Yamada
Quoted 5 lines
Quoted 5 lines
drivers/mtd/nand/denali_spl.c new file +5 -0
+/* nand_init() - initialize data to make nand usable by SPL */
+void nand_init(void)
+{
+	/* access to main area */
+	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 184

Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +4 -0
+
+	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
+	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
+	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);

I believe this will work for ONFI NAND devices only. For non-ONFI, the value might not correct.

I don't think so.
It depends on the hardware; in my understanding
Denali IP is capable of detecting MAIN_AREA_SIZE etc.
for non-ONFI devices. At least this is working with non-ONFI devices on some Panasonic boards.

Quoted 4 lines

If it does not work for Altera SoCs (and if you are planning to use this driver), these three registers should be set in advance in an earlier board init.

I recall one of my colleague was telling me that it doesn't work for one of non ONFI part where it read incorrect page size. Nevertheless, we can put comments so user which use this driver need to take note.

Quoted 22 lines
Quoted 12 lines
Quoted 12 lines
drivers/mtd/nand/denali_spl.c new file +9 -0
+}
+
+int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
+{
+	int block, page, column, readlen;
+	int ret;
+	int force_bad_block_check = 1;
+
+	page = offs / page_size;
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 199

Quoted 6 lines
drivers/mtd/nand/denali_spl.c new file +6 -0
+	column = offs % page_size;
+
+	block = page / pages_per_block;
+	page = page % pages_per_block;
+
+	while (size) {

I believe we need to error out when reading beyond last block.

Quoted 3 lines

How do you know the number of blocks of non-ONFI devices? Scan nand_ids.c for SPL?

I believe we can have a macro for this. But rethinking back, we can skip this check to make the SPL as simple as possible.

Quoted 23 lines
Quoted 17 lines
Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +2 -0
+		if (force_bad_block_check || page == 0) {
+			ret = nand_block_isbad(block);

drivers/mtd/nand/denali_spl.c line 211

Quoted 10 lines
drivers/mtd/nand/denali_spl.c new file +10 -0
+			if (ret < 0)
+				return ret;
+
+			if (ret) {
+				block++;
+				continue;
+			}
+		}
+
+		force_bad_block_check = 0;

I believe we still need to check the subsequent block whether is bad or not too. This can be enable when cross the block boundary.

I am afraid you are misunderstanding my code.

This function does bad block checking for every block.

Quoted 9 lines

Here,

		if (force_bad_block_check || page == 0) {
			ret = nand_block_isbad(block);

"page == 0" means the beginning of each block.

Yup, you are right. I was confused with the variable.

Quoted 11 lines
Quoted 8 lines

Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling the SPL NAND image load. Wonder this driver will be integrated into nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?

I am not planning to do so because:

Quoted 8 lines

[1] nand_spl_simple.c requires CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_PAGE_COUNT; we need to specify the device attributes at compilation, which the Denali IP is able to detect at run time.
It is not acceptable for us because we need (want) the run time configuration.

[2] nand_spl_simple.c is so generic that it cannot use the hardware acceleration of the Denali IP, that is, slower booting.

Yup, you identified the nand_spl_simple.c constrain. This is why I
patched this file at
http://rocketboards.org/gitweb/?p=u-boot-socfpga.git;a=commit;h=461a61b8f03d3b690de1f4ff007cd23fb80018a5. But I didn't send this patch out as I am waiting the NAND driver patch accepted.

Thanks
Chin Liang

Quoted 4 lines

Best Regards
Masahiro Yamada

#5 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

Hi Chin,

Quoted 25 lines · On Mon, 15 Sep 2014 01:39:07 -0500 Chin Liang See <[email protected]> wrote:

Hi Masahiro,

Quoted 21 lines · Masahiro Yamada
Quoted 5 lines
Quoted 5 lines
drivers/mtd/nand/denali_spl.c new file +5 -0
+/* nand_init() - initialize data to make nand usable by SPL */
+void nand_init(void)
+{
+	/* access to main area */
+	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 184

Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +4 -0
+
+	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
+	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
+	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);

I believe this will work for ONFI NAND devices only. For non-ONFI, the value might not correct.

I don't think so.
It depends on the hardware; in my understanding
Denali IP is capable of detecting MAIN_AREA_SIZE etc.
for non-ONFI devices. At least this is working with non-ONFI devices on some Panasonic boards.

Quoted 8 lines
Quoted 4 lines

If it does not work for Altera SoCs (and if you are planning to use this driver), these three registers should be set in advance in an earlier board init.

I recall one of my colleague was telling me that it doesn't work for one of non ONFI part where it read incorrect page size. Nevertheless, we can put comments so user which use this driver need to take note.

I have also heard of that. I think it happens on some Hynix devices.

According to my colleague, for the device with
maf_id = 0xAD, device_id = 0xDA,
the Denali IP seems to set wrong parameters.

Either comments or fixup code like get_hynix_nand_para() in denali.c will do.

BTW I've noticed only a few Hynix devices are supported by denali.c. (only the device id = 0xD5 or 0xD7)

This is, anyway, a upstream limitation and we can send a follow up patch if needed.

Quoted 15 lines
Quoted 15 lines
Quoted 7 lines

Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling the SPL NAND image load. Wonder this driver will be integrated into nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?

I am not planning to do so because:

[1] nand_spl_simple.c requires CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_PAGE_COUNT; we need to specify the device attributes at compilation, which the Denali IP is able to detect at run time.
It is not acceptable for us because we need (want) the run time configuration.

Quoted 7 lines
Quoted 3 lines

[2] nand_spl_simple.c is so generic that it cannot use the hardware acceleration of the Denali IP, that is, slower booting.

Yup, you identified the nand_spl_simple.c constrain. This is why I
patched this file at
http://rocketboards.org/gitweb/?p=u-boot-socfpga.git;a=commit;h=461a61b8f03d3b690de1f4ff007cd23fb80018a5. But I didn't send this patch out as I am waiting the NAND driver patch accepted.

After applying your patch, both [1] and [2] are still the constrain of nand_spl_simple.c

Best Regards
Masahiro Yamada

#6 lore raw

PATCH v4 1/6 nand: denali: add Denali NAND driver for SPL

Hi Masahiro,

Quoted 46 lines · Masahiro Yamada

Hi Chin,

Quoted 25 lines · On Mon, 15 Sep 2014 01:39:07 -0500 Chin Liang See <[email protected]> wrote:

Hi Masahiro,

Quoted 21 lines · Masahiro Yamada
Quoted 5 lines
Quoted 5 lines
drivers/mtd/nand/denali_spl.c new file +5 -0
+/* nand_init() - initialize data to make nand usable by SPL */
+void nand_init(void)
+{
+	/* access to main area */
+	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
Quoted 8 lines

drivers/mtd/nand/denali_spl.c line 184

Quoted 4 lines
drivers/mtd/nand/denali_spl.c new file +4 -0
+
+	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
+	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
+	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);

I believe this will work for ONFI NAND devices only. For non-ONFI, the value might not correct.

I don't think so.
It depends on the hardware; in my understanding
Denali IP is capable of detecting MAIN_AREA_SIZE etc.
for non-ONFI devices. At least this is working with non-ONFI devices on some Panasonic boards.

Quoted 8 lines
Quoted 4 lines

If it does not work for Altera SoCs (and if you are planning to use this driver), these three registers should be set in advance in an earlier board init.

I recall one of my colleague was telling me that it doesn't work for one of non ONFI part where it read incorrect page size. Nevertheless, we can put comments so user which use this driver need to take note.

I have also heard of that. I think it happens on some Hynix devices.

According to my colleague, for the device with
maf_id = 0xAD, device_id = 0xDA,
the Denali IP seems to set wrong parameters.

Quoted 10 lines

Either comments or fixup code like get_hynix_nand_para() in denali.c will do.

BTW I've noticed only a few Hynix devices are supported by denali.c. (only the device id = 0xD5 or 0xD7)

This is, anyway, a upstream limitation and we can send a follow up patch if needed.

Yup, that sound a good plan to enable this patch to move forward. We just need to add some write-up to the commit message.

Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 9 lines

Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling the SPL NAND image load. Wonder this driver will be integrated into nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?

I am not planning to do so because:

[1] nand_spl_simple.c requires CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_PAGE_COUNT; we need to specify the device attributes at compilation, which the Denali IP is able to detect at run time.
It is not acceptable for us because we need (want) the run time configuration.

[2] nand_spl_simple.c is so generic that it cannot use the hardware acceleration of the Denali IP, that is, slower booting.

Quoted 7 lines
Quoted 3 lines

Yup, you identified the nand_spl_simple.c constrain. This is why I
patched this file at
http://rocketboards.org/gitweb/?p=u-boot-socfpga.git;a=commit;h=461a61b8f03d3b690de1f4ff007cd23fb80018a5. But I didn't send this patch out as I am waiting the NAND driver patch accepted.

After applying your patch, both [1] and [2] are still the constrain of nand_spl_simple.c

For [1], yup. But the intention is to ensure it works for various devices and NAND controllers. While for [2], the patch will take advantage of the hardware based ECC calculation. But it will not take advantage of the DMA as I believe DMA might not exist for certain NAND controller.

With that, I don't have much concern to remain this file as this would enable better performance as its specific for Denali. Probably Altera should use this too if its accepted into mainline :)

Thanks
Chin Liang

Quoted 4 lines

Best Regards
Masahiro Yamada

#7 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

In reply to Masahiro Yamada

The driver for on-chip UART used on Panasonic UniPhier platform.

---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Use "const unsigned int mode_x_div = 16"
instead of "#define MODE_X_DIV 16"
- Use DIV_ROUND_CLOSEST() macro to compute the divisor

 drivers/serial/Makefile          |   1 +
 drivers/serial/serial.c          |   2 +
 drivers/serial/serial_uniphier.c | 204 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 207 insertions(+)
 create mode 100644 drivers/serial/serial_uniphier.c
drivers/serial/Makefile +1 -0
index 571c18f..385b2f9 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_BFIN_SERIAL) += serial_bfin.o
 obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o
 obj-$(CONFIG_MXS_AUART) += mxs_auart.o
 obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
+obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial.c +2 -0
index d2eb752..d32673e 100644
@@ -157,6 +157,7 @@ serial_initfunc(sh_serial_initialize);
 serial_initfunc(arm_dcc_initialize);
 serial_initfunc(mxs_auart_initialize);
 serial_initfunc(arc_serial_initialize);
+serial_initfunc(uniphier_serial_initialize);
 
 /**
  * serial_register() - Register serial driver with serial driver core
@@ -250,6 +251,7 @@ void serial_initialize(void)
 	arm_dcc_initialize();
 	mxs_auart_initialize();
 	arc_serial_initialize();
+	uniphier_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_uniphier.c new file +204 -0

204 lines not on this page · raw message

Signature · 1 line
1.9.1
#8 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Quoted 3 lines · Masahiro Yamada

The driver for on-chip UART used on Panasonic UniPhier platform.

[...]

Hi!

drivers/serial/serial_uniphier.c line 87

Quoted 4 lines

+static void uniphier_serial_putc(struct uniphier_serial *port, const char
c) +{

drivers/serial/serial_uniphier.c new file +2 -0
+	if (c == '\n')
+		uniphier_serial_putc(port, '\r');

Just curious, but what is the concensus about inserting \r upon \n ? Shouldn't this be something that the "upper layers" do consistently ? I recall seeing this in some drivers and not seeing this in the others, so I wonder why this is like so ...

drivers/serial/serial_uniphier.c line 93

Quoted 5 lines
drivers/serial/serial_uniphier.c new file +5 -0
+	while (!(readb(&port->lsr) & UART_LSR_THRE))
+		;
+
+	writeb(c, &port->thr);
+}

[...]
Best regards,
Marek Vasut

#9 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Hi Marek,

Quoted 9 lines · On Fri, 5 Sep 2014 12:35:18 +0200 Marek Vasut <[email protected]> wrote:
Quoted 3 lines · Masahiro Yamada

The driver for on-chip UART used on Panasonic UniPhier platform.

[...]

Hi!

Quoted 9 lines

drivers/serial/serial_uniphier.c line 87

Quoted 4 lines

+static void uniphier_serial_putc(struct uniphier_serial *port, const char
c) +{

drivers/serial/serial_uniphier.c new file +2 -0
+	if (c == '\n')
+		uniphier_serial_putc(port, '\r');

Just curious, but what is the concensus about inserting \r upon \n ? Shouldn't this be something that the "upper layers" do consistently ? I recall seeing this in some drivers and not seeing this in the others, so I wonder why this is like so ...

This converts "\n" to "\r\n".

Without this conversion, CarriageReturn is not provided, which means the cursor goes to the next line, but column position does not change.

For example,

printf("Hello\nWorld\n");

will be displayed on (at least my) terminal emulator like this:

Hello
World

With the conversion code, it will be displaye as follows:

Hello
World

Perhaps the behavior might depend on
which therminal emulator you are using.
(also depend on the preference
how LF and CR are handled.)

Maybe we can move "\n -> \r\n" logic
to the upper layer and allow users to enable/disable it with a CONFIG_ option.

Best Regards
Masahiro Yamada

#10 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Quoted 26 lines · Masahiro Yamada

Hi Marek,

On Fri, 5 Sep 2014 12:35:18 +0200

Quoted 9 lines · Marek Vasut
Quoted 3 lines · Masahiro Yamada

The driver for on-chip UART used on Panasonic UniPhier platform.

[...]

Hi!

Quoted 9 lines

drivers/serial/serial_uniphier.c line 87

Quoted 4 lines

+static void uniphier_serial_putc(struct uniphier_serial *port, const char c) +{

drivers/serial/serial_uniphier.c new file +2 -0
+	if (c == '\n')
+		uniphier_serial_putc(port, '\r');

Just curious, but what is the concensus about inserting \r upon \n ? Shouldn't this be something that the "upper layers" do consistently ? I recall seeing this in some drivers and not seeing this in the others, so I wonder why this is like so ...

Quoted 1 line

This converts "\n" to "\r\n".

Apologies, you're right. This is what I meant.

Quoted 18 lines

Without this conversion, CarriageReturn is not provided, which means the cursor goes to the next line, but column position does not change.

For example,

printf("Hello\nWorld\n");

will be displayed on (at least my) terminal emulator like this:

Hello
World

With the conversion code, it will be displaye as follows:

Quoted 7 lines

Hello
World

Perhaps the behavior might depend on
which therminal emulator you are using.
(also depend on the preference
how LF and CR are handled.)

I use minicom . You do have a point that it might be it.

Quoted 3 lines

Maybe we can move "\n -> \r\n" logic
to the upper layer and allow users to enable/disable it with a CONFIG_ option.

Either that or make it even run-time configurable, esp. if this depends on the users' terminal setting.

Best regards,
Marek Vasut

#11 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

In reply to Masahiro Yamada

Hi Masahiro,

Quoted 59 lines · Masahiro Yamada

Hi Marek,

Quoted 14 lines · On Fri, 5 Sep 2014 12:35:18 +0200 Marek Vasut <[email protected]> wrote:
Quoted 3 lines · Masahiro Yamada

The driver for on-chip UART used on Panasonic UniPhier platform.

[...]

Hi!

drivers/serial/serial_uniphier.c line 87

Quoted 4 lines

+static void uniphier_serial_putc(struct uniphier_serial *port, const char
c) +{

drivers/serial/serial_uniphier.c new file +2 -0
+   if (c == '\n')
+           uniphier_serial_putc(port, '\r');
Quoted 4 lines

Just curious, but what is the concensus about inserting \r upon \n ? Shouldn't this be something that the "upper layers" do consistently ? I recall seeing this in some drivers and not seeing this in the others, so I wonder why this is like so ...

This converts "\n" to "\r\n".

Without this conversion, CarriageReturn is not provided, which means the cursor goes to the next line, but column position does not change.

For example,

printf("Hello\nWorld\n");

will be displayed on (at least my) terminal emulator like this:

Hello
World

With the conversion code, it will be displaye as follows:

Hello
World

Perhaps the behavior might depend on
which therminal emulator you are using.
(also depend on the preference
how LF and CR are handled.)

Quoted 3 lines

Maybe we can move "\n -> \r\n" logic
to the upper layer and allow users to enable/disable it with a CONFIG_ option.

Do you think we could use driver model instead? We have the serial infrastructure in place and I will likely merge it next week.

It moves the \r\n logic to a higher level.

It also removes the need for all the horrible #define stuff you have here to deal with multiple serial ports.

Does your board have SPL? If so, does it use serial in SPL?

Regards,
Simon

#12 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Hi Simon,

2014-09-06 1:41 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines

Maybe we can move "\n -> \r\n" logic
to the upper layer and allow users to enable/disable it with a CONFIG_ option.

Do you think we could use driver model instead? We have the serial infrastructure in place and I will likely merge it next week.

OK.
I haven't checked it yet, but I will next week.

Quoted 6 lines

It moves the \r\n logic to a higher level.

It also removes the need for all the horrible #define stuff you have here to deal with multiple serial ports.

Does your board have SPL? If so, does it use serial in SPL?

Yes, all the UniPhier boards have SPL support.

The serial in SPL is not currently supported, but I am planning to add it in the next phase.

Signature · 2 lines
Best Regards
Masahiro Yamada
#13 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

In reply to Simon Glass

Hi Simon,

Quoted 7 lines · On Fri, 5 Sep 2014 10:41:54 -0600 Simon Glass <[email protected]> wrote:

Do you think we could use driver model instead? We have the serial infrastructure in place and I will likely merge it next week.

It moves the \r\n logic to a higher level.

It also removes the need for all the horrible #define stuff you have here to deal with multiple serial ports.

I am seeing serial_find_console_or_panic() func
in drivers/serial/serial-uclass.c

static void serial_find_console_or_panic(void)

{
	int node;

	/* Check for a chosen console */
	node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
	if (node < 0)
		node = fdtdec_get_alias_node(gd->fdt_blob, "console");
	if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &cur_dev))
		return;

	/*
	 * If the console is not marked to be bound before relocation, bind
	 * it anyway.
	 */
	if (node > 0 &&
	    !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &cur_dev)) {
		if (!device_probe(cur_dev))
			return;
		cur_dev = NULL;
	}

It looks like CONFIG_DM_SERIAL depends on CONFIG_OF_CONTROL.

UniPhier SoCs do not support device tree control.
Is the driver model serial still available?
What will happen if gd->fdt_blob is not set?

Best Regards
Masahiro Yamada

#14 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

HI Masahiro,

Quoted 47 lines · Masahiro Yamada

Hi Simon,

Quoted 7 lines · On Fri, 5 Sep 2014 10:41:54 -0600 Simon Glass <[email protected]> wrote:

Do you think we could use driver model instead? We have the serial infrastructure in place and I will likely merge it next week.

It moves the \r\n logic to a higher level.

It also removes the need for all the horrible #define stuff you have here to deal with multiple serial ports.

I am seeing serial_find_console_or_panic() func
in drivers/serial/serial-uclass.c

static void serial_find_console_or_panic(void)

{
        int node;

        /* Check for a chosen console */
        node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
        if (node < 0)
                node = fdtdec_get_alias_node(gd->fdt_blob, "console");
        if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &cur_dev))
                return;

        /*
         * If the console is not marked to be bound before relocation, bind
         * it anyway.
         */
        if (node > 0 &&
            !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &cur_dev)) {
                if (!device_probe(cur_dev))
                        return;
                cur_dev = NULL;
        }
Quoted 7 lines

It looks like CONFIG_DM_SERIAL depends on CONFIG_OF_CONTROL.

UniPhier SoCs do not support device tree control.
Is the driver model serial still available?
What will happen if gd->fdt_blob is not set?

Please this patch.

http://patchwork.ozlabs.org/patch/390433/

I haven't got to a pull request yet for DM, but will do this in the next few days.

Regards,
Simon

#15 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Hi Simon,

2014-09-20 1:30 GMT+09:00 Simon Glass <[email protected]>:

Quoted 9 lines
Quoted 8 lines

It looks like CONFIG_DM_SERIAL depends on CONFIG_OF_CONTROL.

UniPhier SoCs do not support device tree control.
Is the driver model serial still available?
What will happen if gd->fdt_blob is not set?

Quoted 7 lines

Please this patch.

http://patchwork.ozlabs.org/patch/390433/

I haven't got to a pull request yet for DM, but will do this in the next few days.

Can I postpone the driver-model conversion in the next phase?

My first priority is to include the core support of Panasonic SoCs in the 2014.10 release.

We do not have a month before that.
I do not want to be aggressive now.

First, I want the current well-tested code to be upstreamed and see where I stand.
And then I can move forward to the next development.

(Once I have a stable code in the mainline,
I can consult "git-bisect" whenever something is broken in the future development.)

Signature · 2 lines
Best Regards
Masahiro Yamada
#16 lore raw

PATCH v4 2/6 serial: add UniPhier serial driver

Hi Masahiro,

Quoted 30 lines · Masahiro YAMADA

Hi Simon,

2014-09-20 1:30 GMT+09:00 Simon Glass <[email protected]>:

Quoted 9 lines
Quoted 8 lines

It looks like CONFIG_DM_SERIAL depends on CONFIG_OF_CONTROL.

UniPhier SoCs do not support device tree control.
Is the driver model serial still available?
What will happen if gd->fdt_blob is not set?

Quoted 7 lines

Please this patch.

http://patchwork.ozlabs.org/patch/390433/

I haven't got to a pull request yet for DM, but will do this in the next few days.

Can I postpone the driver-model conversion in the next phase?

My first priority is to include the core support of Panasonic SoCs in the 2014.10 release.

We do not have a month before that.
I do not want to be aggressive now.

Quoted 7 lines

First, I want the current well-tested code to be upstreamed and see where I stand.
And then I can move forward to the next development.

(Once I have a stable code in the mainline,
I can consult "git-bisect" whenever something is broken in the future development.)

That seems fine to me. It is good to do things in stages.

Regards,
Simon

#17 lore raw

PATCH v4 3/6 arm: uniphier: add UniPhier SoC support code

In reply to Masahiro Yamada

These are used by Panasonic UniPhier SoC family.

---

Changes in v4:
- Disable Denali NAND driver.
This driver has been taking too long:
http://patchwork.ozlabs.org/patch/381305/

Changes in v3:
- Add Denali fixup code for PH1-sLD8 and PH1-Pro4

Changes in v2:
- Rebase
- Remove unnecessary CONFIG_SYS_NAND_PAGE_SIZE definition
- Fix a typo in the subject

 arch/arm/cpu/armv7/uniphier/Makefile               |   23 +
 arch/arm/cpu/armv7/uniphier/board_common.c         |   32 +
 arch/arm/cpu/armv7/uniphier/board_late_init.c      |   82 ++
 arch/arm/cpu/armv7/uniphier/cache_uniphier.c       |  154 +++
 arch/arm/cpu/armv7/uniphier/cmd_pinmon.c           |   33 +
 arch/arm/cpu/armv7/uniphier/cpu_info.c             |   59 ++
 arch/arm/cpu/armv7/uniphier/dram_init.c            |   37 +
 arch/arm/cpu/armv7/uniphier/init_page_table.c      | 1068 ++++++++++++++++++++
 arch/arm/cpu/armv7/uniphier/lowlevel_init.S        |  159 +++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile       |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c     |   33 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c   |   16 +
 .../armv7/uniphier/ph1-ld4/board_postclk_init.c    |   42 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c    |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c  |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c      |   63 ++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c     |  189 ++++
 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c     |   44 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c      |   28 +
 arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c     |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile      |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c  |   16 +
 .../armv7/uniphier/ph1-pro4/board_postclk_init.c   |   39 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c   |   66 ++
 arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c     |   45 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c    |  168 +++
 .../arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c |   18 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c    |   75 ++
 arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c     |   28 +
 arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c    |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile      |   10 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c    |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c  |   16 +
 .../armv7/uniphier/ph1-sld8/board_postclk_init.c   |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c   |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c |   29 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c     |   57 ++
 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c    |  201 ++++
 .../arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c    |   51 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c     |    1 +
 arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c    |   10 +
 arch/arm/cpu/armv7/uniphier/reset.c                |   29 +
 arch/arm/cpu/armv7/uniphier/smp.S                  |   54 +
 arch/arm/cpu/armv7/uniphier/spl.c                  |   17 +
 arch/arm/cpu/armv7/uniphier/support_card.c         |  180 ++++
 arch/arm/cpu/armv7/uniphier/timer.c                |   39 +
 arch/arm/include/asm/arch-uniphier/arm-mpcore.h    |   46 +
 arch/arm/include/asm/arch-uniphier/bcu-regs.h      |   29 +
 arch/arm/include/asm/arch-uniphier/board.h         |   35 +
 arch/arm/include/asm/arch-uniphier/boot-device.h   |   20 +
 arch/arm/include/asm/arch-uniphier/led.h           |  101 ++
 arch/arm/include/asm/arch-uniphier/sbc-regs.h      |  107 ++
 arch/arm/include/asm/arch-uniphier/sc-regs.h       |   62 ++
 arch/arm/include/asm/arch-uniphier/sg-regs.h       |  182 ++++
 arch/arm/include/asm/arch-uniphier/ssc-regs.h      |   65 ++
 include/configs/ph1_ld4.h                          |   59 ++
 include/configs/ph1_pro4.h                         |   61 ++
 include/configs/ph1_sld8.h                         |   59 ++
 include/configs/uniphier-common.h                  |  279 +++++
 62 files changed, 4420 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/uniphier/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/board_common.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/board_late_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cache_uniphier.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cmd_pinmon.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/cpu_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/dram_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/init_page_table.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/board_postclk_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/reset.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/smp.S
 create mode 100644 arch/arm/cpu/armv7/uniphier/spl.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/support_card.c
 create mode 100644 arch/arm/cpu/armv7/uniphier/timer.c
 create mode 100644 arch/arm/include/asm/arch-uniphier/arm-mpcore.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/bcu-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/board.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/boot-device.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/led.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sbc-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sc-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/sg-regs.h
 create mode 100644 arch/arm/include/asm/arch-uniphier/ssc-regs.h
 create mode 100644 include/configs/ph1_ld4.h
 create mode 100644 include/configs/ph1_pro4.h
 create mode 100644 include/configs/ph1_sld8.h
 create mode 100644 include/configs/uniphier-common.h
arch/arm/cpu/armv7/uniphier/Makefile new file +23 -0
new file mode 100644
index 0000000..7ceddda
@@ -0,0 +1,23 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_SPL_BUILD) += lowlevel_init.o init_page_table.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
+
+obj-y += timer.o
+obj-y += reset.o
+obj-y += cache_uniphier.o
+obj-y += dram_init.o
+obj-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o
+obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o
+obj-$(CONFIG_UNIPHIER_SMP) += smp.o
+obj-$(if $(CONFIG_SPL_BUILD),,y) += cmd_pinmon.o
+
+obj-y += board_common.o
+obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += support_card.o
+obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += support_card.o
+
+obj-$(CONFIG_MACH_PH1_LD4) += ph1-ld4/
+obj-$(CONFIG_MACH_PH1_PRO4) += ph1-pro4/
+obj-$(CONFIG_MACH_PH1_SLD8) += ph1-sld8/
arch/arm/cpu/armv7/uniphier/board_common.c new file +32 -0
new file mode 100644
index 0000000..3fb26c6
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/led.h>
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+	led_write(U, B, O, O);
+
+	return 0;
+}
+
+#if CONFIG_NR_DRAM_BANKS >= 2
+void dram_init_banksize(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+
+	gd->bd->bi_dram[0].start = CONFIG_SDRAM0_BASE;
+	gd->bd->bi_dram[0].size  = CONFIG_SDRAM0_SIZE;
+	gd->bd->bi_dram[1].start = CONFIG_SDRAM1_BASE;
+	gd->bd->bi_dram[1].size  = CONFIG_SDRAM1_SIZE;
+}
+#endif
arch/arm/cpu/armv7/uniphier/board_late_init.c new file +82 -0

82 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/cache_uniphier.c new file +154 -0

154 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/cmd_pinmon.c new file +33 -0
new file mode 100644
index 0000000..eef9f39
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/boot-device.h>
+
+static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	struct boot_device_info *table;
+	u32 mode_sel, n = 0;
+
+	mode_sel = get_boot_mode_sel();
+
+	puts("Boot Mode Pin:\n");
+
+	for (table = boot_device_table; strlen(table->info); table++) {
+		printf(" %c %02x %s\n", n == mode_sel ? '*' : ' ', n,
+		       table->info);
+		n++;
+	}
+
+	return 0;
+}
+
+U_BOOT_CMD(
+	pinmon,	1,	1,	do_pinmon,
+	"pin monitor",
+	""
+);
arch/arm/cpu/armv7/uniphier/cpu_info.c new file +59 -0

59 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/dram_init.c new file +37 -0
new file mode 100644
index 0000000..5465a0e
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/led.h>
+
+int umc_init(void);
+void enable_dpll_ssc(void);
+
+int dram_init(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
+	led_write(B, 4, , );
+
+	{
+		int res;
+
+		res = umc_init();
+		if (res < 0)
+			return res;
+	}
+	led_write(B, 5, , );
+
+	enable_dpll_ssc();
+#endif
+
+	led_write(B, 6, , );
+
+	return 0;
+}
arch/arm/cpu/armv7/uniphier/init_page_table.c new file +1068 -0

1,068 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/lowlevel_init.S new file +159 -0

159 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile new file +10 -0
new file mode 100644
index 0000000..b385e19
@@ -0,0 +1,10 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
+obj-y += boot-mode.o
+obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
+		sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
+obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
+	umc_init.o
arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c new file +33 -0
new file mode 100644
index 0000000..85f37f2
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/bcu-regs.h>
+
+#define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x11111111 : 0x11111111 << (x))
+
+void bcu_init(void)
+{
+	int shift;
+
+	writel(0x44444444, BCSCR0); /* 0x20000000-0x3fffffff: ASM bus */
+	writel(0x11111111, BCSCR2); /* 0x80000000-0x9fffffff: IPPC/IPPD-bus */
+	writel(0x11111111, BCSCR3); /* 0xa0000000-0xbfffffff: IPPC/IPPD-bus */
+	writel(0x11111111, BCSCR4); /* 0xc0000000-0xdfffffff: IPPC/IPPD-bus */
+	writel(0x11111111, BCSCR5); /* 0xe0000000-0Xffffffff: IPPC/IPPD-bus */
+
+	/* Specify DDR channel */
+	shift = (CONFIG_SDRAM1_BASE - CONFIG_SDRAM0_BASE) / 0x04000000 * 4;
+	writel(ch(shift), BCIPPCCHR2); /* 0x80000000-0x9fffffff */
+
+	shift -= 32;
+	writel(ch(shift), BCIPPCCHR3); /* 0xa0000000-0xbfffffff */
+
+	shift -= 32;
+	writel(ch(shift), BCIPPCCHR4); /* 0xc0000000-0xdfffffff */
+}
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c new file +16 -0
new file mode 100644
index 0000000..27d772e
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/board.h>
+
+int checkboard(void)
+{
+	puts("Board: PH1-LD4 Board\n");
+
+	return check_support_card();
+}
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c new file +42 -0

42 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c new file +1 -0
new file mode 100644
index 0000000..d359b56
@@ -0,0 +1 @@
+#include "../ph1-pro4/boot-mode.c"
arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c new file +29 -0
new file mode 100644
index 0000000..18965a9
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sc-regs.h>
+
+void clkrst_init(void)
+{
+	u32 tmp;
+
+	/* deassert reset */
+	tmp = readl(SC_RSTCTRL);
+	tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
+		| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
+	writel(tmp, SC_RSTCTRL);
+	readl(SC_RSTCTRL); /* dummy read */
+
+	/* privide clocks */
+	tmp = readl(SC_CLKCTRL);
+	tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
+	     | SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
+	writel(tmp, SC_CLKCTRL);
+	readl(SC_CLKCTRL); /* dummy read */
+}
arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c new file +63 -0

63 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c new file +189 -0

189 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c new file +1 -0
new file mode 100644
index 0000000..837b2a8
@@ -0,0 +1 @@
+#include "../ph1-pro4/pll_spectrum.c"
arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c new file +44 -0

44 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c new file +28 -0
new file mode 100644
index 0000000..b4dd799
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sg-regs.h>
+
+void sg_init(void)
+{
+	u32 tmp;
+
+	/* Set DDR size */
+	tmp = sg_memconf_val_ch0(CONFIG_SDRAM0_SIZE, CONFIG_DDR_NUM_CH0);
+	tmp |= sg_memconf_val_ch1(CONFIG_SDRAM1_SIZE, CONFIG_DDR_NUM_CH1);
+#if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE < CONFIG_SDRAM1_BASE
+	tmp |= SG_MEMCONF_SPARSEMEM;
+#endif
+	writel(tmp, SG_MEMCONF);
+
+	/* Input ports must be enabled deasserting reset of cores */
+	tmp = readl(SG_IECTRL);
+	tmp |= 0x1;
+	writel(tmp, SG_IECTRL);
+}
arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c new file +10 -0
new file mode 100644
index 0000000..e0e586b
@@ -0,0 +1,10 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+int umc_init(void)
+{
+	return 0;
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile new file +10 -0
new file mode 100644
index 0000000..712afd1
@@ -0,0 +1,10 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
+obj-y += boot-mode.o
+obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o sbc_init.o \
+				sg_init.o pll_init.o clkrst_init.o pinctrl.o
+obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
+	umc_init.o
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c new file +16 -0
new file mode 100644
index 0000000..325a4f6
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/board.h>
+
+int checkboard(void)
+{
+	puts("Board: PH1-Pro4 Board\n");
+
+	return check_support_card();
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c new file +39 -0
new file mode 100644
index 0000000..7198829
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/led.h>
+#include <asm/arch/board.h>
+
+void sbc_init(void);
+void sg_init(void);
+void pll_init(void);
+void pin_init(void);
+void clkrst_init(void);
+
+int board_postclk_init(void)
+{
+	sbc_init();
+
+	sg_init();
+
+	pll_init();
+
+	uniphier_board_init();
+
+	led_write(B, 1, , );
+
+	clkrst_init();
+
+	led_write(B, 2, , );
+
+	pin_init();
+
+	led_write(B, 3, , );
+
+	return 0;
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c new file +66 -0

66 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c new file +29 -0
new file mode 100644
index 0000000..18965a9
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sc-regs.h>
+
+void clkrst_init(void)
+{
+	u32 tmp;
+
+	/* deassert reset */
+	tmp = readl(SC_RSTCTRL);
+	tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
+		| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
+	writel(tmp, SC_RSTCTRL);
+	readl(SC_RSTCTRL); /* dummy read */
+
+	/* privide clocks */
+	tmp = readl(SC_CLKCTRL);
+	tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
+	     | SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
+	writel(tmp, SC_CLKCTRL);
+	readl(SC_CLKCTRL); /* dummy read */
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c new file +45 -0

45 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c new file +168 -0

168 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c new file +18 -0
new file mode 100644
index 0000000..4538d1a
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sc-regs.h>
+
+void enable_dpll_ssc(void)
+{
+	u32 tmp;
+
+	tmp = readl(SC_DPLLCTRL);
+	tmp |= SC_DPLLCTRL_SSC_EN;
+	writel(tmp, SC_DPLLCTRL);
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c new file +75 -0

75 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c new file +28 -0
new file mode 100644
index 0000000..b4dd799
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sg-regs.h>
+
+void sg_init(void)
+{
+	u32 tmp;
+
+	/* Set DDR size */
+	tmp = sg_memconf_val_ch0(CONFIG_SDRAM0_SIZE, CONFIG_DDR_NUM_CH0);
+	tmp |= sg_memconf_val_ch1(CONFIG_SDRAM1_SIZE, CONFIG_DDR_NUM_CH1);
+#if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE < CONFIG_SDRAM1_BASE
+	tmp |= SG_MEMCONF_SPARSEMEM;
+#endif
+	writel(tmp, SG_MEMCONF);
+
+	/* Input ports must be enabled deasserting reset of cores */
+	tmp = readl(SG_IECTRL);
+	tmp |= 0x1;
+	writel(tmp, SG_IECTRL);
+}
arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c new file +10 -0
new file mode 100644
index 0000000..e0e586b
@@ -0,0 +1,10 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+int umc_init(void)
+{
+	return 0;
+}
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile new file +10 -0
new file mode 100644
index 0000000..b385e19
@@ -0,0 +1,10 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
+obj-y += boot-mode.o
+obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
+		sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
+obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
+	umc_init.o
arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c new file +1 -0
new file mode 100644
index 0000000..69b172e
@@ -0,0 +1 @@
+#include "../ph1-ld4/bcu_init.c"
arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c new file +16 -0
new file mode 100644
index 0000000..15dc289
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/board.h>
+
+int checkboard(void)
+{
+	puts("Board: PH1-sLD8 Board\n");
+
+	return check_support_card();
+}
arch/arm/cpu/armv7/uniphier/ph1-sld8/board_postclk_init.c new file +1 -0
new file mode 100644
index 0000000..287b33c
@@ -0,0 +1 @@
+#include "../ph1-ld4/board_postclk_init.c"
arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c new file +1 -0
new file mode 100644
index 0000000..d359b56
@@ -0,0 +1 @@
+#include "../ph1-pro4/boot-mode.c"
arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c new file +29 -0
new file mode 100644
index 0000000..18965a9
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sc-regs.h>
+
+void clkrst_init(void)
+{
+	u32 tmp;
+
+	/* deassert reset */
+	tmp = readl(SC_RSTCTRL);
+	tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
+		| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
+	writel(tmp, SC_RSTCTRL);
+	readl(SC_RSTCTRL); /* dummy read */
+
+	/* privide clocks */
+	tmp = readl(SC_CLKCTRL);
+	tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
+	     | SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
+	writel(tmp, SC_CLKCTRL);
+	readl(SC_CLKCTRL); /* dummy read */
+}
arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c new file +57 -0

57 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c new file +201 -0

201 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c new file +1 -0
new file mode 100644
index 0000000..9b8c485
@@ -0,0 +1 @@
+#include "../ph1-ld4/pll_spectrum.c"
arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c new file +51 -0

51 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c new file +1 -0
new file mode 100644
index 0000000..a808289
@@ -0,0 +1 @@
+#include "../ph1-ld4/sg_init.c"
arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c new file +10 -0
new file mode 100644
index 0000000..e0e586b
@@ -0,0 +1,10 @@
+/*
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+int umc_init(void)
+{
+	return 0;
+}
arch/arm/cpu/armv7/uniphier/reset.c new file +29 -0
new file mode 100644
index 0000000..b0dc967
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2012-2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <[email protected]>
+ *
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

arch/arm/cpu/armv7/uniphier/smp.S new file +54 -0

54 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/spl.c new file +17 -0
new file mode 100644
index 0000000..40d28ad

Lines of this file are not shown. View the raw message.

arch/arm/cpu/armv7/uniphier/support_card.c new file +180 -0

180 lines not on this page · raw message

arch/arm/cpu/armv7/uniphier/timer.c new file +39 -0
new file mode 100644
index 0000000..6edc084

Lines of this file are not shown. View the raw message.

arch/arm/include/asm/arch-uniphier/arm-mpcore.h new file +46 -0

46 lines not on this page · raw message

arch/arm/include/asm/arch-uniphier/bcu-regs.h new file +29 -0
new file mode 100644
index 0000000..5501b36

Lines of this file are not shown. View the raw message.

arch/arm/include/asm/arch-uniphier/board.h new file +35 -0
new file mode 100644
index 0000000..e6ba4e4

Lines of this file are not shown. View the raw message.

arch/arm/include/asm/arch-uniphier/boot-device.h new file +20 -0
new file mode 100644
index 0000000..6987f57

Lines of this file are not shown. View the raw message.

arch/arm/include/asm/arch-uniphier/led.h new file +101 -0

101 lines not on this page · raw message

arch/arm/include/asm/arch-uniphier/sbc-regs.h new file +107 -0

107 lines not on this page · raw message

arch/arm/include/asm/arch-uniphier/sc-regs.h new file +62 -0

62 lines not on this page · raw message

arch/arm/include/asm/arch-uniphier/sg-regs.h new file +182 -0

182 lines not on this page · raw message

arch/arm/include/asm/arch-uniphier/ssc-regs.h new file +65 -0

65 lines not on this page · raw message

include/configs/ph1_ld4.h new file +59 -0

59 lines not on this page · raw message

include/configs/ph1_pro4.h new file +61 -0

61 lines not on this page · raw message

include/configs/ph1_sld8.h new file +59 -0

59 lines not on this page · raw message

include/configs/uniphier-common.h new file +279 -0

279 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#18 lore raw

PATCH v4 3/6 arm: uniphier: add UniPhier SoC support code

Hi Masahiro,

Quoted 1 line · Masahiro Yamada

init_page_table

Why do you need a full page table in this code? Can you not use the existing page table features in U-Boot?

Regards,
Simon

#19 lore raw

PATCH v4 3/6 arm: uniphier: add UniPhier SoC support code

Hi Simon,

2014-09-06 3:59 GMT+09:00 Simon Glass <[email protected]>:

Quoted 7 lines

Hi Masahiro,

Quoted 1 line · Masahiro Yamada

init_page_table

Why do you need a full page table in this code? Can you not use the existing page table features in U-Boot?

I assume you mentioned mmu_setup() function in arch/arm/lib/cache-cp15.c. I do know it and actually my boards are using it too.

The hardware specification of UniPhier platform is a little special and unfortunate in terms of RAM / Cache handling. UniPhier SoCs have no on-chip SRAM!

Let's assume U-boot is booting from NOR Flash.

We have to setup the stack before junping to board_f(), but there is no writable memory at this moment on our SoCs. (UniPhier has SDRAMs, of course, but it is intialized in board_f().)

To solve the problem, our SoCs use a trick to have stack on L2Cache. To use cache, MMU must be turned on. (This is ARM specification)

That's why hard-coded, full page table must be placed in the code.

When SDRAM is available, the page table is switched to the one created in arch/arm/lib/cached-cp15.c, but which is much lator (board_r() func.)

Best Regards
Masahiro Yamada

#20 lore raw

PATCH v4 3/6 arm: uniphier: add UniPhier SoC support code

Hi Masahiro,

Quoted 28 lines · Masahiro YAMADA

Hi Simon,

2014-09-06 3:59 GMT+09:00 Simon Glass <[email protected]>:

Quoted 7 lines

Hi Masahiro,

Quoted 1 line · Masahiro Yamada

init_page_table

Why do you need a full page table in this code? Can you not use the existing page table features in U-Boot?

I assume you mentioned mmu_setup() function in arch/arm/lib/cache-cp15.c. I do know it and actually my boards are using it too.

The hardware specification of UniPhier platform is a little special and unfortunate in terms of RAM / Cache handling. UniPhier SoCs have no on-chip SRAM!

Let's assume U-boot is booting from NOR Flash.

We have to setup the stack before junping to board_f(), but there is no writable memory at this moment on our SoCs. (UniPhier has SDRAMs, of course, but it is intialized in board_f().)

Quoted 8 lines

To solve the problem, our SoCs use a trick to have stack on L2Cache. To use cache, MMU must be turned on. (This is ARM specification)

That's why hard-coded, full page table must be placed in the code.

When SDRAM is available, the page table is switched to the one created in arch/arm/lib/cached-cp15.c, but which is much lator (board_r() func.)

OK I see. It is a big hassle not having any SRAM available. Yes maybe this is better than a macro/loop in an assembler file.

Regards,
Simon

#21 lore raw

PATCH v4 4/6 arm: uniphier: add Kconfig and defconfig

In reply to Masahiro Yamada

Add entries for Panasonic UniPhier family:
PH1-LD4, PH1-Pro4, PH1-sLD8

---

Changes in v4: None
Changes in v3:
- Rebase on the current u-boot/master

Changes in v2:
- Rebase on the current u-boot/master

 arch/arm/Kconfig                    |  5 +++++
 arch/arm/cpu/armv7/uniphier/Kconfig | 32 ++++++++++++++++++++++++++++++++
 configs/ph1_ld4_defconfig           |  4 ++++
 configs/ph1_pro4_defconfig          |  4 ++++
 configs/ph1_sld8_defconfig          |  4 ++++
 5 files changed, 49 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/uniphier/Kconfig
 create mode 100644 configs/ph1_ld4_defconfig
 create mode 100644 configs/ph1_pro4_defconfig
 create mode 100644 configs/ph1_sld8_defconfig
arch/arm/Kconfig +5 -0
index 22f0f09..9a35639 100644
@@ -509,6 +509,9 @@ config TARGET_COLIBRI_PXA270
 config TARGET_JORNADA
 	bool "Support jornada"
 
+config ARCH_UNIPHIER
+	bool "Panasonic UniPhier platform"
+
 endchoice
 
 source "arch/arm/cpu/arm926ejs/davinci/Kconfig"
@@ -535,6 +538,8 @@ source "arch/arm/cpu/armv7/rmobile/Kconfig"
 
 source "arch/arm/cpu/armv7/tegra-common/Kconfig"
 
+source "arch/arm/cpu/armv7/uniphier/Kconfig"
+
 source "arch/arm/cpu/arm926ejs/versatile/Kconfig"
 
 source "arch/arm/cpu/armv7/zynq/Kconfig"
arch/arm/cpu/armv7/uniphier/Kconfig new file +32 -0
new file mode 100644
index 0000000..34f5496
@@ -0,0 +1,32 @@
+menu "Panasonic UniPhier platform"
+	depends on ARCH_UNIPHIER
+
+config SYS_CPU
+	string
+	default "armv7"
+
+config SYS_SOC
+	string
+	default "uniphier"
+
+config SYS_CONFIG_NAME
+	string
+	default "ph1_pro4" if MACH_PH1_PRO4
+	default "ph1_ld4" if MACH_PH1_LD4
+	default "ph1_sld8" if MACH_PH1_SLD8
+
+choice
+	prompt "UniPhier SoC select"
+
+config MACH_PH1_PRO4
+	bool "PH1-Pro4"
+
+config MACH_PH1_LD4
+	bool "PH1-LD4"
+
+config MACH_PH1_SLD8
+	bool "PH1-sLD8"
+
+endchoice
+
+endmenu
configs/ph1_ld4_defconfig new file +4 -0
new file mode 100644
index 0000000..d6fcb25
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_UNIPHIER=y
++S:CONFIG_MACH_PH1_LD4=y
configs/ph1_pro4_defconfig new file +4 -0
new file mode 100644
index 0000000..557b3aa
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_UNIPHIER=y
++S:CONFIG_MACH_PH1_PRO4=y
configs/ph1_sld8_defconfig new file +4 -0
new file mode 100644
index 0000000..8028d12
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_UNIPHIER=y
++S:CONFIG_MACH_PH1_SLD8=y
Signature · 1 line
1.9.1
#22 lore raw

PATCH v4 5/6 MAINTAINERS: add me as a maintainer of UniPhier platform

In reply to Masahiro Yamada

---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Newly added

 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index af194ca..cb5b3f0 100644
@@ -149,6 +149,14 @@ F:	arch/arm/include/asm/arch-davinci/
 F:	arch/arm/include/asm/arch-omap*/
 F:	arch/arm/include/asm/ti-common/
 
+ARM UNIPHIER
+M:	Masahiro Yamada <[email protected]>
+S:	Maintained
+F:	arch/arm/cpu/armv7/uniphier/
+F:	arch/arm/include/asm/arch-uniphier/
+F:	configs/ph1_*_defconfig
+F:	drivers/serial/serial_uniphier.c
+
 ARM ZYNQ
 M:	Michal Simek <[email protected]>
 S:	Maintained
Signature · 1 line
1.9.1
#23 lore raw

PATCH v4 5/6 MAINTAINERS: add me as a maintainer of UniPhier platform

Hi Masahiro,

Quoted 20 lines · Masahiro Yamada

---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Newly added

 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +1 -0
index af194ca..cb5b3f0 100644
@@ -149,6 +149,14 @@ F:	arch/arm/include/asm/arch-davinci/
 F:	arch/arm/include/asm/arch-omap*/
 F:	arch/arm/include/asm/ti-common/
 
+ARM UNIPHIER

MAINTAINERS F: arch/arm/include/asm/arch-davinci/ · line 162

Quoted 10 lines
MAINTAINERS +7 -0
+M:	Masahiro Yamada <[email protected]>
+S:	Maintained
+F:	arch/arm/cpu/armv7/uniphier/
+F:	arch/arm/include/asm/arch-uniphier/
+F:	configs/ph1_*_defconfig
+F:	drivers/serial/serial_uniphier.c
+
 ARM ZYNQ
 M:	Michal Simek <[email protected]>
 S:	Maintained

Amicalement,

Signature · 1 line
Albert.
#24 lore raw

PATCH v4 5/6 MAINTAINERS: add me as a maintainer of UniPhier platform

Hi Masahiro,

Quoted 24 lines · Albert ARIBAUD

Hi Masahiro,

Quoted 19 lines · Masahiro Yamada

---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Newly added

 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +0 -0
index af194ca..cb5b3f0 100644
@@ -149,6 +149,14 @@ F:	arch/arm/include/asm/arch-davinci/
 F:	arch/arm/include/asm/arch-omap*/
 F:	arch/arm/include/asm/ti-common/
 
Quoted 13 lines

MAINTAINERS F: arch/arm/include/asm/arch-davinci/ · line 162

Quoted 11 lines
MAINTAINERS +8 -0
+ARM UNIPHIER
+M:	Masahiro Yamada <[email protected]>
+S:	Maintained
+F:	arch/arm/cpu/armv7/uniphier/
+F:	arch/arm/include/asm/arch-uniphier/
+F:	configs/ph1_*_defconfig
+F:	drivers/serial/serial_uniphier.c
+
 ARM ZYNQ
 M:	Michal Simek <[email protected]>
 S:	Maintained

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140918/7fe4cf7f/attachment.pgp>
#25 lore raw

PATCH v4 6/6 git-mailrc: add me as a maintainer of UniPhier platform

In reply to Masahiro Yamada

---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Rebase

 doc/git-mailrc | 1 +
 1 file changed, 1 insertion(+)
doc/git-mailrc +1 -0
index 0fba100..35f2eb2 100644
@@ -63,6 +63,7 @@ alias sunxi          uboot, ijc, jwrdegoede
 alias tegra          uboot, sjg, Tom Warren <[email protected]>, Stephen Warren <[email protected]>
 alias tegra2         tegra
 alias ti             uboot, trini
+alias uniphier       uboot, masahiro
 alias zynq           uboot, monstr
 
 alias avr32          uboot, abiessmann
Signature · 1 line
1.9.1