mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org, Oleksij Rempel <linux@rempel-privat.de>
Subject: Re: [RFC 3/4] MIPS: ath79: add black-swift board support
Date: Thu, 17 Sep 2015 07:44:28 +0200	[thread overview]
Message-ID: <20150917054428.GO4018@pengutronix.de> (raw)
In-Reply-To: <1442392292-15898-4-git-send-email-antonynpavlov@gmail.com>

On Wed, Sep 16, 2015 at 11:31:31AM +0300, Antony Pavlov wrote:
> Black Swift is a tiny coin-sized embedded computer based on AR9331 SoC.
> See http://www.black-swift.com/ for details.
> 
> See also Black Swift kickstarter page:
>   https://www.kickstarter.com/projects/1133560316/black-swift-tiny-wireless-computer
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  arch/mips/Makefile                                 |  1 +
>  arch/mips/boards/black-swift/Makefile              |  1 +
>  arch/mips/boards/black-swift/board.c               | 27 +++++++++++++
>  .../black-swift/include/board/board_pbl_start.h    | 46 ++++++++++++++++++++++
>  arch/mips/dts/black-swift.dts                      | 36 +++++++++++++++++
>  arch/mips/mach-ath79/Kconfig                       |  5 +++
>  6 files changed, 116 insertions(+)
> 
> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index 6ef2bf7..75761b5 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -80,6 +80,7 @@ board-$(CONFIG_BOARD_NETGEAR_WG102)	:= netgear-wg102
>  
>  machine-$(CONFIG_MACH_MIPS_ATH79)	:= ath79
>  board-$(CONFIG_BOARD_TPLINK_MR3020)	:= tplink-mr3020
> +board-$(CONFIG_BOARD_BLACK_SWIFT)	:= black-swift
>  
>  machine-$(CONFIG_MACH_MIPS_BCM47XX)	:= bcm47xx
>  board-$(CONFIG_BOARD_DLINK_DIR320)	:= dlink-dir-320
> diff --git a/arch/mips/boards/black-swift/Makefile b/arch/mips/boards/black-swift/Makefile
> new file mode 100644
> index 0000000..dcfc293
> --- /dev/null
> +++ b/arch/mips/boards/black-swift/Makefile
> @@ -0,0 +1 @@
> +obj-y += board.o
> diff --git a/arch/mips/boards/black-swift/board.c b/arch/mips/boards/black-swift/board.c
> new file mode 100644
> index 0000000..2e2ed20
> --- /dev/null
> +++ b/arch/mips/boards/black-swift/board.c
> @@ -0,0 +1,27 @@
> +/*
> + * Copyright (C) 2015 Antony Pavlov <antonynpavlov@gmail.com>
> + *
> + * This file is part of barebox.
> + * See file CREDITS for list of people who contributed to this project.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +
> +static int model_hostname_init(void)
> +{
> +	barebox_set_hostname("black-swift");
> +
> +	return 0;
> +}
> +postcore_initcall(model_hostname_init);
> diff --git a/arch/mips/boards/black-swift/include/board/board_pbl_start.h b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
> new file mode 100644
> index 0000000..176491f
> --- /dev/null
> +++ b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
> @@ -0,0 +1,46 @@
> +/*
> + * Copyright (C) 2013, 2015 Antony Pavlov <antonynpavlov@gmail.com>
> + * Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.de>
> + *
> + * This file is part of barebox.
> + * See file CREDITS for list of people who contributed to this project.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <asm/pbl_macros.h>
> +#include <mach/pbl_macros.h>
> +
> +	.macro	board_pbl_start
> +	.set	push
> +	.set	noreorder
> +
> +	mips_barebox_10h
> +
> +	mips_disable_interrupts
> +
> +	pbl_ar9331_pll
> +	pbl_ar9331_ddr2_config
> +
> +	/*
> +	 * General Purpose I/O Function (GPIO_FUNCTION_1)
> +	 *
> +	 *  SPI_EN  (18) enables SPI SPA Interface signals
> +	 *               in GPIO_2, GPIO_3, GPIO_4 and GPIO_5.
> +	 *  RES     (15) reserved. This bit must be written with 1.
> +	 *  UART_EN  (2) enables UART I/O on GPIO_9 (SIN) and GPIO_10 (SOUT).
> +	 */
> +	pbl_reg_writel 0x48002, 0xb8040028
> +
> +	copy_to_link_location	pbl_start
> +
> +	.set	pop
> +	.endm
> diff --git a/arch/mips/dts/black-swift.dts b/arch/mips/dts/black-swift.dts
> new file mode 100644
> index 0000000..db13c73
> --- /dev/null
> +++ b/arch/mips/dts/black-swift.dts
> @@ -0,0 +1,36 @@
> +/dts-v1/;
> +
> +#include "ar9331.dtsi"
> +
> +/ {
> +	model = "Black Swift";
> +	compatible = "smartlx,black-swift";
> +
> +	memory {
> +		reg = <0x00000000 0x4000000>;
> +	};
> +};
> +
> +&serial0 {
> +	status = "okay";
> +};
> +
> +&spi {
> +	num-chipselects = <1>;
> +	status = "okay";
> +
> +	/* Winbond W25Q128FV SPI flash */
> +	spiflash: m25p80@0 {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		compatible = "m25p80";
> +		spi-max-frequency = <104000000>;
> +		reg = <0>;
> +	};
> +};
> +
> +/ {
> +	aliases {
> +		spiflash = &spiflash;
> +	};

I would expect this aliases node near the top of this file, that's where
aliases usually are.

Otherwise this series looks good to me, but I can't say much to it as I
don't know mips assembly. If it works for you I am fine with it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-09-17  5:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16  8:31 [RFC 0/4] MIPS: barebox as a first stage loader on the Black Swift board Antony Pavlov
2015-09-16  8:31 ` [RFC 1/4] MIPS: ar933x: pbl: add pbl_ar9331_pll macro Antony Pavlov
2015-09-16  8:31 ` [RFC 2/4] MIPS: ar933x: pbl: add pbl_ar9331_ddr2_config macro Antony Pavlov
2015-09-16  8:31 ` [RFC 3/4] MIPS: ath79: add black-swift board support Antony Pavlov
2015-09-17  5:44   ` Sascha Hauer [this message]
2015-09-16  8:31 ` [RFC 4/4] MIPS: add black-swift_defconfig Antony Pavlov
2015-09-16 10:19 ` [RFC 0/4] MIPS: barebox as a first stage loader on the Black Swift board Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150917054428.GO4018@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox