linux/drivers/pinctrl/renesas/pfc-r8a7778.c

// SPDX-License-Identifier: GPL-2.0
/*
 * r8a7778 processor support - PFC hardware block
 *
 * Copyright (C) 2013  Renesas Solutions Corp.
 * Copyright (C) 2013  Kuninori Morimoto <[email protected]>
 * Copyright (C) 2013  Cogent Embedded, Inc.
 * Copyright (C) 2015  Ulrich Hecht
 *
 * based on
 * Copyright (C) 2011  Renesas Solutions Corp.
 * Copyright (C) 2011  Magnus Damm
 */

#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/pinctrl/pinconf-generic.h>

#include "sh_pfc.h"

#define CPU_ALL_GP(fn, sfx)

#define CPU_ALL_NOGP(fn)

enum {};

static const u16 pinmux_data[] =;

/*
 * Pins not associated with a GPIO port.
 */
enum {};

static const struct sh_pfc_pin pinmux_pins[] =;

/* - macro */
#define SH_PFC_PINS(name, args...)
#define SH_PFC_MUX1(name, arg1)
#define SH_PFC_MUX2(name, arg1, arg2)
#define SH_PFC_MUX3(name, arg1, arg2, arg3)
#define SH_PFC_MUX4(name, arg1, arg2, arg3, arg4)
#define SH_PFC_MUX8(name, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)

/* - AUDIO macro -------------------------------------------------------------*/
#define AUDIO_PFC_PIN(name, pin)
#define AUDIO_PFC_DAT(name, pin)

/* - AUDIO clock -------------------------------------------------------------*/
AUDIO_PFC_PIN(audio_clk_a,	RCAR_GP_PIN(2, 22));
AUDIO_PFC_DAT();
AUDIO_PFC_PIN(audio_clk_b,	RCAR_GP_PIN(2, 23));
AUDIO_PFC_DAT();
AUDIO_PFC_PIN(audio_clk_c,	RCAR_GP_PIN(2, 7));
AUDIO_PFC_DAT();
AUDIO_PFC_PIN(audio_clkout_a,	RCAR_GP_PIN(2, 16));
AUDIO_PFC_DAT();
AUDIO_PFC_PIN(audio_clkout_b,	RCAR_GP_PIN(1, 16));
AUDIO_PFC_DAT();

/* - CAN macro --------_----------------------------------------------------- */
#define CAN_PFC_PINS(name, args...)
#define CAN_PFC_DATA(name, tx, rx)
#define CAN_PFC_CLK(name, clk)

/* - CAN0 ------------------------------------------------------------------- */
CAN_PFC_PINS();
CAN_PFC_DATA();
CAN_PFC_PINS();
CAN_PFC_DATA();

/* - CAN1 ------------------------------------------------------------------- */
CAN_PFC_PINS();
CAN_PFC_DATA();
CAN_PFC_PINS();
CAN_PFC_DATA();

/* - CAN_CLK  --------------------------------------------------------------- */
CAN_PFC_PINS(can_clk_a,		RCAR_GP_PIN(3, 24));
CAN_PFC_CLK();
CAN_PFC_PINS(can_clk_b,		RCAR_GP_PIN(1, 16));
CAN_PFC_CLK();
CAN_PFC_PINS(can_clk_c,		RCAR_GP_PIN(4, 24));
CAN_PFC_CLK();
CAN_PFC_PINS(can_clk_d,		RCAR_GP_PIN(2, 25));
CAN_PFC_CLK();

/* - Ether ------------------------------------------------------------------ */
SH_PFC_PINS();
static const unsigned int ether_rmii_mux[] =;
SH_PFC_PINS(ether_link,		RCAR_GP_PIN(4, 19));
SH_PFC_MUX1();
SH_PFC_PINS(ether_magic,	RCAR_GP_PIN(4, 20));
SH_PFC_MUX1();

/* - SCIF macro ------------------------------------------------------------- */
#define SCIF_PFC_PIN(name, args...)
#define SCIF_PFC_DAT(name, tx, rx)
#define SCIF_PFC_CTR(name, cts, rts)
#define SCIF_PFC_CLK(name, sck)

/* - HSCIF0 ----------------------------------------------------------------- */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN(hscif0_clk,	RCAR_GP_PIN(1, 19));
SCIF_PFC_CLK();

/* - HSCIF1 ----------------------------------------------------------------- */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN(hscif1_clk_a,	RCAR_GP_PIN(3, 23));
SCIF_PFC_CLK();
SCIF_PFC_PIN(hscif1_clk_b,	RCAR_GP_PIN(4, 2));
SCIF_PFC_CLK();

/* - HSPI macro --------------------------------------------------------------*/
#define HSPI_PFC_PIN(name, args...)
#define HSPI_PFC_DAT(name, clk, cs, rx, tx)

/* - HSPI0 -------------------------------------------------------------------*/
HSPI_PFC_PIN();
HSPI_PFC_DAT();

HSPI_PFC_PIN();
HSPI_PFC_DAT();

/* - HSPI1 -------------------------------------------------------------------*/
HSPI_PFC_PIN();
HSPI_PFC_DAT();

HSPI_PFC_PIN();
HSPI_PFC_DAT();

/* - HSPI2 -------------------------------------------------------------------*/
HSPI_PFC_PIN();
HSPI_PFC_DAT();

HSPI_PFC_PIN();
HSPI_PFC_DAT();

/* - I2C macro ------------------------------------------------------------- */
#define I2C_PFC_PIN(name, args...)
#define I2C_PFC_MUX(name, sda, scl)

/* - I2C1 ------------------------------------------------------------------ */
I2C_PFC_PIN();
I2C_PFC_MUX();
I2C_PFC_PIN();
I2C_PFC_MUX();

/* - I2C2 ------------------------------------------------------------------ */
I2C_PFC_PIN();
I2C_PFC_MUX();
I2C_PFC_PIN();
I2C_PFC_MUX();
I2C_PFC_PIN();
I2C_PFC_MUX();

/* - I2C3 ------------------------------------------------------------------ */
I2C_PFC_PIN();
I2C_PFC_MUX();
I2C_PFC_PIN();
I2C_PFC_MUX();
I2C_PFC_PIN();
I2C_PFC_MUX();

/* - LBSC ------------------------------------------------------------------- */
SH_PFC_PINS(lbsc_cs0,		PIN_CS0);
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_cs1,		PIN_CS1_A26);
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs0,	RCAR_GP_PIN(1, 3));
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs1,	RCAR_GP_PIN(1, 4));
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs2,	RCAR_GP_PIN(1, 5));
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs3,	RCAR_GP_PIN(1, 6));
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs4,	RCAR_GP_PIN(1, 7));
SH_PFC_MUX1();
SH_PFC_PINS(lbsc_ex_cs5,	RCAR_GP_PIN(1, 8));
SH_PFC_MUX1();

/* - MMC macro -------------------------------------------------------------- */
#define MMC_PFC_PINS(name, args...)
#define MMC_PFC_CTRL(name, clk, cmd)
#define MMC_PFC_DAT8(name, d0, d1, d2, d3, d4, d5, d6, d7)

/* - MMC -------------------------------------------------------------------- */
MMC_PFC_PINS();
MMC_PFC_CTRL();
MMC_PFC_PINS();
MMC_PFC_DAT8();

/* - SCIF CLOCK ------------------------------------------------------------- */
SCIF_PFC_PIN(scif_clk,		RCAR_GP_PIN(1, 16));
SCIF_PFC_CLK();

/* - SCIF0 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN(scif0_clk,		RCAR_GP_PIN(1, 19));
SCIF_PFC_CLK();

/* - SCIF1 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN();
SCIF_PFC_CTR();
SCIF_PFC_PIN(scif1_clk_a,	RCAR_GP_PIN(4, 2));
SCIF_PFC_CLK();
SCIF_PFC_PIN(scif1_clk_c,	RCAR_GP_PIN(3, 20));
SCIF_PFC_CLK();

/* - SCIF2 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN(scif2_clk_a,	RCAR_GP_PIN(3, 9));
SCIF_PFC_CLK();
SCIF_PFC_PIN(scif2_clk_b,	PIN_CS1_A26);
SCIF_PFC_CLK();
SCIF_PFC_PIN(scif2_clk_c,	RCAR_GP_PIN(4, 12));
SCIF_PFC_CLK();

/* - SCIF3 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();

/* - SCIF4 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();

/* - SCIF5 ------------------------------------------------------------------ */
SCIF_PFC_PIN();
SCIF_PFC_DAT();
SCIF_PFC_PIN();
SCIF_PFC_DAT();

/* - SDHI macro ------------------------------------------------------------- */
#define SDHI_PFC_PINS(name, args...)
#define SDHI_PFC_DAT4(name, d0, d1, d2, d3)
#define SDHI_PFC_CTRL(name, clk, cmd)
#define SDHI_PFC_CDPN(name, cd)
#define SDHI_PFC_WPPN(name, wp)

/* - SDHI0 ------------------------------------------------------------------ */
SDHI_PFC_PINS(sdhi0_cd,		RCAR_GP_PIN(3, 17));
SDHI_PFC_CDPN();
SDHI_PFC_PINS();
SDHI_PFC_CTRL();
SDHI_PFC_PINS();
SDHI_PFC_DAT4();
SDHI_PFC_PINS(sdhi0_wp,		RCAR_GP_PIN(3, 18));
SDHI_PFC_WPPN();

/* - SDHI1 ------------------------------------------------------------------ */
SDHI_PFC_PINS(sdhi1_cd_a,	RCAR_GP_PIN(0, 30));
SDHI_PFC_CDPN();
SDHI_PFC_PINS(sdhi1_cd_b,	RCAR_GP_PIN(2, 24));
SDHI_PFC_CDPN();
SDHI_PFC_PINS();
SDHI_PFC_CTRL();
SDHI_PFC_PINS();
SDHI_PFC_CTRL();
SDHI_PFC_PINS();
SDHI_PFC_DAT4();
SDHI_PFC_PINS();
SDHI_PFC_DAT4();
SDHI_PFC_PINS(sdhi1_wp_a,	RCAR_GP_PIN(0, 31));
SDHI_PFC_WPPN();
SDHI_PFC_PINS(sdhi1_wp_b,	RCAR_GP_PIN(2, 25));
SDHI_PFC_WPPN();

/* - SDH2 ------------------------------------------------------------------- */
SDHI_PFC_PINS(sdhi2_cd_a,	RCAR_GP_PIN(4, 23));
SDHI_PFC_CDPN();
SDHI_PFC_PINS(sdhi2_cd_b,	RCAR_GP_PIN(3, 27));
SDHI_PFC_CDPN();
SDHI_PFC_PINS();
SDHI_PFC_CTRL();
SDHI_PFC_PINS();
SDHI_PFC_CTRL();
SDHI_PFC_PINS();
SDHI_PFC_DAT4();
SDHI_PFC_PINS();
SDHI_PFC_DAT4();
SDHI_PFC_PINS(sdhi2_wp_a,	RCAR_GP_PIN(4, 24));
SDHI_PFC_WPPN();
SDHI_PFC_PINS(sdhi2_wp_b,	RCAR_GP_PIN(3, 28));
SDHI_PFC_WPPN();

/* - SSI macro -------------------------------------------------------------- */
#define SSI_PFC_PINS(name, args...)
#define SSI_PFC_CTRL(name, sck, ws)
#define SSI_PFC_DATA(name, d)

/* - SSI 0/1/2 -------------------------------------------------------------- */
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi0_data,		RCAR_GP_PIN(3, 10));
SSI_PFC_DATA();
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi1_data,		RCAR_GP_PIN(3, 9));
SSI_PFC_DATA();
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi2_data,		RCAR_GP_PIN(3, 8));
SSI_PFC_DATA();

/* - SSI 3/4 ---------------------------------------------------------------- */
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi3_data,		RCAR_GP_PIN(3, 5));
SSI_PFC_DATA();
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi4_data,		RCAR_GP_PIN(3, 4));
SSI_PFC_DATA();

/* - SSI 5 ------------------------------------------------------------------ */
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi5_data,		RCAR_GP_PIN(3, 1));
SSI_PFC_DATA();

/* - SSI 6 ------------------------------------------------------------------ */
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi6_data,		RCAR_GP_PIN(2, 30));
SSI_PFC_DATA();

/* - SSI 7/8  --------------------------------------------------------------- */
SSI_PFC_PINS();
SSI_PFC_CTRL();
SSI_PFC_PINS(ssi7_data,		RCAR_GP_PIN(2, 27));
SSI_PFC_DATA();
SSI_PFC_PINS(ssi8_data,		RCAR_GP_PIN(2, 26));
SSI_PFC_DATA();

/* - USB0 ------------------------------------------------------------------- */
SH_PFC_PINS(usb0,		RCAR_GP_PIN(0, 1));
SH_PFC_MUX1();
SH_PFC_PINS(usb0_ovc,		RCAR_GP_PIN(0, 3));
SH_PFC_MUX1();

/* - USB1 ------------------------------------------------------------------- */
SH_PFC_PINS(usb1,		RCAR_GP_PIN(0, 2));
SH_PFC_MUX1();
SH_PFC_PINS(usb1_ovc,		RCAR_GP_PIN(0, 4));
SH_PFC_MUX1();

/* - VIN macros ------------------------------------------------------------- */
#define VIN_PFC_PINS(name, args...)
#define VIN_PFC_DAT8(name, d0, d1, d2, d3, d4, d5, d6, d7)
#define VIN_PFC_CLK(name, clk)
#define VIN_PFC_SYNC(name, hsync, vsync)

/* - VIN0 ------------------------------------------------------------------- */
VIN_PFC_PINS();
VIN_PFC_DAT8();
VIN_PFC_PINS(vin0_clk,		RCAR_GP_PIN(3, 24));
VIN_PFC_CLK();
VIN_PFC_PINS();
VIN_PFC_SYNC();
/* - VIN1 ------------------------------------------------------------------- */
VIN_PFC_PINS();
VIN_PFC_DAT8();
VIN_PFC_PINS(vin1_clk,		RCAR_GP_PIN(4, 9));
VIN_PFC_CLK();
VIN_PFC_PINS();
VIN_PFC_SYNC();

static const struct sh_pfc_pin_group pinmux_groups[] =;

static const char * const audio_clk_groups[] =;

static const char * const can0_groups[] =;

static const char * const can1_groups[] =;

static const char * const ether_groups[] =;

static const char * const hscif0_groups[] =;

static const char * const hscif1_groups[] =;

static const char * const hspi0_groups[] =;

static const char * const hspi1_groups[] =;

static const char * const hspi2_groups[] =;

static const char * const i2c1_groups[] =;

static const char * const i2c2_groups[] =;

static const char * const i2c3_groups[] =;

static const char * const lbsc_groups[] =;

static const char * const mmc_groups[] =;

static const char * const scif_clk_groups[] =;

static const char * const scif0_groups[] =;

static const char * const scif1_groups[] =;

static const char * const scif2_groups[] =;

static const char * const scif3_groups[] =;

static const char * const scif4_groups[] =;

static const char * const scif5_groups[] =;


static const char * const sdhi0_groups[] =;

static const char * const sdhi1_groups[] =;

static const char * const sdhi2_groups[] =;

static const char * const ssi_groups[] =;

static const char * const usb0_groups[] =;

static const char * const usb1_groups[] =;

static const char * const vin0_groups[] =;

static const char * const vin1_groups[] =;

static const struct sh_pfc_function pinmux_functions[] =;

static const struct pinmux_cfg_reg pinmux_config_regs[] =;

static const struct pinmux_bias_reg pinmux_bias_regs[] =;

static const struct sh_pfc_soc_operations r8a7778_pfc_ops =;

const struct sh_pfc_soc_info r8a7778_pinmux_info =;