From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from magratgarlick.emantor.de ([78.46.208.201] helo=margratgarlick.emantor.de) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZCv9-0002qj-8C for barebox@lists.infradead.org; Tue, 18 Dec 2018 10:48:24 +0000 From: Rouven Czerwinski Date: Tue, 18 Dec 2018 11:47:41 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v5 6/9] ARM: rpi: add NS16550 support To: barebox@lists.infradead.org Cc: Rouven Czerwinski Since the 16550 driver now supports the RPI3 miniuart, enable it in the default config. Signed-off-by: Rouven Czerwinski --- arch/arm/configs/rpi_defconfig | 1 + drivers/serial/serial_ns16550.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/rpi_defconfig b/arch/arm/configs/rpi_defconfig index 2bb6158..dc5ab1f 100644 --- a/arch/arm/configs/rpi_defconfig +++ b/arch/arm/configs/rpi_defconfig @@ -63,6 +63,7 @@ CONFIG_CMD_OF_PROPERTY=y CONFIG_CMD_OFTREE=y CONFIG_CMD_TIME=y CONFIG_SERIAL_AMBA_PL011=y +CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_MCI=y CONFIG_MCI_BCM283X=y CONFIG_LED=y diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 256063a..5e5b671 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -253,11 +253,15 @@ static void ns16550_jz_init_port(struct console_device *cdev) ns16550_serial_init_port(cdev); } +#define BCM2836_AUX_CLOCK_ENB 0x3f215004 /* BCM2835 AUX Clock enable register */ +#define BCM2836_AUX_CLOCK_EN_UART BIT(0) /* Bit 0 enables the Miniuart */ + static void rpi_init_port(struct console_device *cdev) { + uint8_t val; struct ns16550_priv *priv = to_ns16550_priv(cdev); - writeb(0x01, 0x3f215004); + writeb(BCM2835_AUX_CLOCK_EN_UART, BCM2835_AUX_CLOCK_ENB); priv->plat.shift = 2; /* * We double the clock rate since the 16550 will divide by 16 -- git-series 0.9.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox