[U-Boot] [PATCH v6] spi: pl022_spi: Add support for ARM PL022 spi controller

Armando Visconti armando.visconti at st.com
Wed Sep 14 16:39:05 CEST 2016


Ciao Michael,

On 09/08/2016 04:21 PM, Michael Brandl wrote:
> Dear U-Boot (SPI) Developers,
>
> this patch seems to be my only chance to get spi working without/before Linux.

I wrote and used this code for u-boot for a asic
specified by one of our customers. The patch was generic
enough to be pushed in u-boot, but I didn't have
much time to test it on a different, more generic
platform. So the maintainer decided to drop it...

Would be nice if you could work on it and resurrect it...
:)

Let me know if you have progressed on this or abandoned it.

>
> I'm a student from Augsburg (Germany) experimenting with the Hikey Board from 96boards.
> The hi6220 processor from HiSilicon isn't fully documented, there is just one document called Function Description:
> http://mirror.lemaker.org/Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf
>

Yes, I'm currently using HiKey platform for doing my day by day
job here in office. Nevertheless, I don't think I have enough
time to take a look into testing this commit.

> U-Boot already supports the Hikey Board to be loaded from ARM Trusted Firmware (ATF) but only UART and SDMMC is supported by now.
> I cloned the u-boot-spi.git and tried to integrate this patch but I'm not experienced enough to adjust the specific config for the Hikey Board.
>

Maybe I can try to recover the work that was done to integrate
this commit into the customer platform I was talking about.
I'll take a look into it right now...

> Taking a look at armv7 devices with spi support I started like this:
>
> +++ b/arch/arm/include/asm/arch-hi6220/hi6220.h
>
> +/*Hi6220V100_Multi-Mode_Application_Processor_Function_Description on p.5-45*/
> +#define HI6220_SPI_BASE				0xF7106000
>
>
> +++ b/include/configs/hikey.h
>
> +/* Synchronous Serial Port PL022 for SPI */
> +#define CONFIG_PL022_SPI
>
>
> +++ b/board/hisilicon/hikey/hikey.c
>
>  int board_init(void)
>  {
> +#ifdef CONFIG_PL022_SPI
> +	hikey_spi0_hw_init();
> +#endif
>  	return 0;
>  }
>
>
> +static void hikey_spi0_hw_init(void)
> +{
> +	hi6220_pinmux_config(PERIPH_ID_SPI0)
> +//	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
> +	gpio_request(0, "PWR_HOLD_GPIO0_0");
> +	gpio_direction_output(0, 1);
> +
> +	/* Enable clock */
> +//	at91_periph_clk_enable(ATMEL_ID_SPI0);
> +/* from Kernel	{ HI6220_SPI_CLK, "spi_clk", "clk_150m", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x230, 9,  0, }, */
> +	hi6220_clk_enable(PERI_CLK0_SPI0, &peri_sc->clk3_en);
> +
> +}
> +#endif /* CONFIG_PL022_SPI */
> +
>
>
> +++ b/arch/arm/cpu/armv8/hisilicon/pinmux.c
>
> +static void hi6220_spi_config(int peripheral)
> +{
> +	switch (peripheral) {
> +	case PERIPH_ID_SPI0:
> +//		at91_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
> +//		at91_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
> +//		at91_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
> +		break;
> +
> +	case PERIPH_ID_SPI1:
> +		break;
> +
> +	default:
> +		debug("%s: invalid peripheral %d", __func__, peripheral);
> +		return;
> +	}
> +}
>
> Maybe you can help me to get spi working on Hikey. My overall aim is to port the pl022 driver then to ARM TF ... maybe also that could be interessing for you.
>
> With kind Regards,
> Michael Brandl
>
>
>
>

Rgds,
Armando



More information about the U-Boot mailing list