summaryrefslogtreecommitdiffstats
path: root/build/isolinux.cfg
blob: 487226e14f53c21157c12f66ff83796c38329cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
default vesamenu.c32
timeout 600

display boot.msg

# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title CentOS 7
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13

# Border Area
menu color border * #00000000 #00000000 none

# Selected item
menu color sel 0 #ffffffff #00000000 none

# Title bar
menu color title 0 #ff7ba3d0 #00000000 none

# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none

# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none

# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none

# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none

# Help text
menu color help 0 #ffffffff #00000000 none

# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none

# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none

# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none

# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.

menu tabmsg Press Tab for full configuration options on menu items.

menu separator # insert an empty line
menu separator # insert an empty line

label linux
  menu label ^Install Apex OPNFV :: CentOS 7
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=OPNFV\x20CentOS\x207\x20x86_64

#label check
#  menu label Test this ^media & install CentOS 7
#  kernel vmlinuz
#  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet

menu separator # insert an empty line

# utilities submenu
menu begin ^Troubleshooting
  menu title Troubleshooting

label vesa
  menu indent count 5
  menu label Install CentOS 7 in ^basic graphics mode
  text help
	Try this option out if you're having trouble installing
	CentOS 7.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=OPNFV\x20CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet

label rescue
  menu indent count 5
  menu label ^Rescue a CentOS system
  text help
	If the system will not boot, this lets you access files
	and edit config files to try to get it booting again.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet

label memtest
  menu label Run a ^memory test
  text help
	If your system is having issues, a problem with your
	system's memory may be the cause. Use this utility to
	see if the memory is working correctly.
  endtext
  kernel memtest

menu separator # insert an empty line

label local
  menu label Boot from ^local drive
  localboot 0xffff

menu separator # insert an empty line
menu separator # insert an empty line

label returntomain
  menu label Return to ^main menu
  menu exit

menu end
/ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (C) ST-Ericsson SA 2012
 *
 * Author: Patrice Chotard <patrice.chotard@stericsson.com> for ST-Ericsson.
 *
 * 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.
 */

#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/mfd/abx500/ab8500.h>
#include "pinctrl-abx500.h"

/* All the pins that can be used for GPIO and some other functions */
#define ABX500_GPIO(offset)		(offset)

#define AB9540_PIN_R4		ABX500_GPIO(1)
#define AB9540_PIN_V3		ABX500_GPIO(2)
#define AB9540_PIN_T4		ABX500_GPIO(3)
#define AB9540_PIN_T5		ABX500_GPIO(4)
/* hole */
#define AB9540_PIN_B18		ABX500_GPIO(10)
#define AB9540_PIN_C18		ABX500_GPIO(11)
/* hole */
#define AB9540_PIN_D18		ABX500_GPIO(13)
#define AB9540_PIN_B19		ABX500_GPIO(14)
#define AB9540_PIN_C19		ABX500_GPIO(15)
#define AB9540_PIN_D19		ABX500_GPIO(16)
#define AB9540_PIN_R3		ABX500_GPIO(17)
#define AB9540_PIN_T2		ABX500_GPIO(18)
#define AB9540_PIN_U2		ABX500_GPIO(19)
#define AB9540_PIN_V2		ABX500_GPIO(20)
#define AB9540_PIN_N17		ABX500_GPIO(21)
#define AB9540_PIN_N16		ABX500_GPIO(22)
#define AB9540_PIN_M19		ABX500_GPIO(23)
#define AB9540_PIN_T3		ABX500_GPIO(24)
#define AB9540_PIN_W2		ABX500_GPIO(25)
/* hole */
#define AB9540_PIN_H4		ABX500_GPIO(27)
#define AB9540_PIN_F1		ABX500_GPIO(28)
#define AB9540_PIN_F4		ABX500_GPIO(29)
#define AB9540_PIN_F2		ABX500_GPIO(30)
#define AB9540_PIN_E4		ABX500_GPIO(31)
#define AB9540_PIN_F3		ABX500_GPIO(32)
/* hole */
#define AB9540_PIN_J13		ABX500_GPIO(34)
/* hole */
#define AB9540_PIN_L17		ABX500_GPIO(40)
#define AB9540_PIN_L16		ABX500_GPIO(41)
#define AB9540_PIN_W3		ABX500_GPIO(42)
#define AB9540_PIN_N4		ABX500_GPIO(50)
#define AB9540_PIN_G12		ABX500_GPIO(51)
#define AB9540_PIN_E17		ABX500_GPIO(52)
#define AB9540_PIN_D11		ABX500_GPIO(53)
#define AB9540_PIN_M18		ABX500_GPIO(54)

/* indicates the highest GPIO number */
#define AB9540_GPIO_MAX_NUMBER	54

/*
 * The names of the pins are denoted by GPIO number and ball name, even
 * though they can be used for other things than GPIO, this is the first
 * column in the table of the data sheet and often used on schematics and
 * such.
 */
static const struct pinctrl_pin_desc ab9540_pins[] = {
	PINCTRL_PIN(AB9540_PIN_R4, "GPIO1_R4"),
	PINCTRL_PIN(AB9540_PIN_V3, "GPIO2_V3"),
	PINCTRL_PIN(AB9540_PIN_T4, "GPIO3_T4"),
	PINCTRL_PIN(AB9540_PIN_T5, "GPIO4_T5"),
	/* hole */
	PINCTRL_PIN(AB9540_PIN_B18, "GPIO10_B18"),
	PINCTRL_PIN(AB9540_PIN_C18, "GPIO11_C18"),
	/* hole */
	PINCTRL_PIN(AB9540_PIN_D18, "GPIO13_D18"),
	PINCTRL_PIN(AB9540_PIN_B19, "GPIO14_B19"),
	PINCTRL_PIN(AB9540_PIN_C19, "GPIO15_C19"),
	PINCTRL_PIN(AB9540_PIN_D19, "GPIO16_D19"),
	PINCTRL_PIN(AB9540_PIN_R3, "GPIO17_R3"),
	PINCTRL_PIN(AB9540_PIN_T2, "GPIO18_T2"),
	PINCTRL_PIN(AB9540_PIN_U2, "GPIO19_U2"),
	PINCTRL_PIN(AB9540_PIN_V2, "GPIO20_V2"),
	PINCTRL_PIN(AB9540_PIN_N17, "GPIO21_N17"),
	PINCTRL_PIN(AB9540_PIN_N16, "GPIO22_N16"),
	PINCTRL_PIN(AB9540_PIN_M19, "GPIO23_M19"),
	PINCTRL_PIN(AB9540_PIN_T3, "GPIO24_T3"),
	PINCTRL_PIN(AB9540_PIN_W2, "GPIO25_W2"),
	/* hole */
	PINCTRL_PIN(AB9540_PIN_H4, "GPIO27_H4"),
	PINCTRL_PIN(AB9540_PIN_F1, "GPIO28_F1"),
	PINCTRL_PIN(AB9540_PIN_F4, "GPIO29_F4"),
	PINCTRL_PIN(AB9540_PIN_F2, "GPIO30_F2"),
	PINCTRL_PIN(AB9540_PIN_E4, "GPIO31_E4"),
	PINCTRL_PIN(AB9540_PIN_F3, "GPIO32_F3"),
	/* hole */
	PINCTRL_PIN(AB9540_PIN_J13, "GPIO34_J13"),
	/* hole */
	PINCTRL_PIN(AB9540_PIN_L17, "GPIO40_L17"),
	PINCTRL_PIN(AB9540_PIN_L16, "GPIO41_L16"),
	PINCTRL_PIN(AB9540_PIN_W3, "GPIO42_W3"),
	PINCTRL_PIN(AB9540_PIN_N4, "GPIO50_N4"),
	PINCTRL_PIN(AB9540_PIN_G12, "GPIO51_G12"),
	PINCTRL_PIN(AB9540_PIN_E17, "GPIO52_E17"),
	PINCTRL_PIN(AB9540_PIN_D11, "GPIO53_D11"),
	PINCTRL_PIN(AB9540_PIN_M18, "GPIO60_M18"),
};

/*
 * Maps local GPIO offsets to local pin numbers
 */
static const struct abx500_pinrange ab9540_pinranges[] = {
	ABX500_PINRANGE(1, 4, ABX500_ALT_A),
	ABX500_PINRANGE(10, 2, ABX500_DEFAULT),
	ABX500_PINRANGE(13, 1, ABX500_DEFAULT),
	ABX500_PINRANGE(14, 12, ABX500_ALT_A),
	ABX500_PINRANGE(27, 6, ABX500_ALT_A),
	ABX500_PINRANGE(34, 1, ABX500_ALT_A),
	ABX500_PINRANGE(40, 3, ABX500_ALT_A),
	ABX500_PINRANGE(50, 1, ABX500_DEFAULT),
	ABX500_PINRANGE(51, 3, ABX500_ALT_A),
	ABX500_PINRANGE(54, 1, ABX500_DEFAULT),
};

/*
 * Read the pin group names like this:
 * sysclkreq2_d_1 = first groups of pins for sysclkreq2 on default function
 *
 * The groups are arranged as sets per altfunction column, so we can
 * mux in one group at a time by selecting the same altfunction for them
 * all. When functions require pins on different altfunctions, you need
 * to combine several groups.
 */

/* default column */
static const unsigned sysclkreq2_d_1_pins[] = { AB9540_PIN_R4 };
static const unsigned sysclkreq3_d_1_pins[] = { AB9540_PIN_V3 };
static const unsigned sysclkreq4_d_1_pins[] = { AB9540_PIN_T4 };
static const unsigned sysclkreq6_d_1_pins[] = { AB9540_PIN_T5 };
static const unsigned gpio10_d_1_pins[] = { AB9540_PIN_B18 };
static const unsigned gpio11_d_1_pins[] = { AB9540_PIN_C18 };
static const unsigned gpio13_d_1_pins[] = { AB9540_PIN_D18 };
static const unsigned pwmout1_d_1_pins[] = { AB9540_PIN_B19 };
static const unsigned pwmout2_d_1_pins[] = { AB9540_PIN_C19 };
static const unsigned pwmout3_d_1_pins[] = { AB9540_PIN_D19 };
/* audio data interface 1*/
static const unsigned adi1_d_1_pins[] = { AB9540_PIN_R3, AB9540_PIN_T2,
					AB9540_PIN_U2, AB9540_PIN_V2 };
/* USBUICC */
static const unsigned usbuicc_d_1_pins[] = { AB9540_PIN_N17, AB9540_PIN_N16,
					AB9540_PIN_M19 };
static const unsigned sysclkreq7_d_1_pins[] = { AB9540_PIN_T3 };
static const unsigned sysclkreq8_d_1_pins[] = { AB9540_PIN_W2 };
/* Digital microphone 1 and 2 */
static const unsigned dmic12_d_1_pins[] = { AB9540_PIN_H4, AB9540_PIN_F1 };
/* Digital microphone 3 and 4 */
static const unsigned dmic34_d_1_pins[] = { AB9540_PIN_F4, AB9540_PIN_F2 };
/* Digital microphone 5 and 6 */
static const unsigned dmic56_d_1_pins[] = { AB9540_PIN_E4, AB9540_PIN_F3 };
static const unsigned extcpena_d_1_pins[] = { AB9540_PIN_J13 };
/* modem SDA/SCL */
static const unsigned modsclsda_d_1_pins[] = { AB9540_PIN_L17, AB9540_PIN_L16 };
static const unsigned sysclkreq5_d_1_pins[] = { AB9540_PIN_W3 };
static const unsigned gpio50_d_1_pins[] = { AB9540_PIN_N4 };
static const unsigned batremn_d_1_pins[] = { AB9540_PIN_G12 };
static const unsigned resethw_d_1_pins[] = { AB9540_PIN_E17 };
static const unsigned service_d_1_pins[] = { AB9540_PIN_D11 };
static const unsigned gpio60_d_1_pins[] = { AB9540_PIN_M18 };

/* Altfunction A column */
static const unsigned gpio1_a_1_pins[] = { AB9540_PIN_R4 };
static const unsigned gpio2_a_1_pins[] = { AB9540_PIN_V3 };
static const unsigned gpio3_a_1_pins[] = { AB9540_PIN_T4 };
static const unsigned gpio4_a_1_pins[] = { AB9540_PIN_T5 };
static const unsigned hiqclkena_a_1_pins[] = { AB9540_PIN_B18 };
static const unsigned pdmclk_a_1_pins[] = { AB9540_PIN_C18 };
static const unsigned uartdata_a_1_pins[] = { AB9540_PIN_D18, AB9540_PIN_N4 };
static const unsigned gpio14_a_1_pins[] = { AB9540_PIN_B19 };
static const unsigned gpio15_a_1_pins[] = { AB9540_PIN_C19 };
static const unsigned gpio16_a_1_pins[] = { AB9540_PIN_D19 };
static const unsigned gpio17_a_1_pins[] = { AB9540_PIN_R3 };
static const unsigned gpio18_a_1_pins[] = { AB9540_PIN_T2 };
static const unsigned gpio19_a_1_pins[] = { AB9540_PIN_U2 };
static const unsigned gpio20_a_1_pins[] = { AB9540_PIN_V2 };
static const unsigned gpio21_a_1_pins[] = { AB9540_PIN_N17 };
static const unsigned gpio22_a_1_pins[] = { AB9540_PIN_N16 };
static const unsigned gpio23_a_1_pins[] = { AB9540_PIN_M19 };
static const unsigned gpio24_a_1_pins[] = { AB9540_PIN_T3 };
static const unsigned gpio25_a_1_pins[] = { AB9540_PIN_W2 };
static const unsigned gpio27_a_1_pins[] = { AB9540_PIN_H4 };
static const unsigned gpio28_a_1_pins[] = { AB9540_PIN_F1 };
static const unsigned gpio29_a_1_pins[] = { AB9540_PIN_F4 };
static const unsigned gpio30_a_1_pins[] = { AB9540_PIN_F2 };
static const unsigned gpio31_a_1_pins[] = { AB9540_PIN_E4 };
static const unsigned gpio32_a_1_pins[] = { AB9540_PIN_F3 };
static const unsigned gpio34_a_1_pins[] = { AB9540_PIN_J13 };
static const unsigned gpio40_a_1_pins[] = { AB9540_PIN_L17 };
static const unsigned gpio41_a_1_pins[] = { AB9540_PIN_L16 };
static const unsigned gpio42_a_1_pins[] = { AB9540_PIN_W3 };
static const unsigned gpio51_a_1_pins[] = { AB9540_PIN_G12 };
static const unsigned gpio52_a_1_pins[] = { AB9540_PIN_E17 };
static const unsigned gpio53_a_1_pins[] = { AB9540_PIN_D11 };
static const unsigned usbuiccpd_a_1_pins[] = { AB9540_PIN_M18 };

/* Altfunction B colum */
static const unsigned pdmdata_b_1_pins[] = { AB9540_PIN_B18 };
static const unsigned pwmextvibra1_b_1_pins[] = { AB9540_PIN_D18 };
static const unsigned pwmextvibra2_b_1_pins[] = { AB9540_PIN_N4 };

/* Altfunction C column */
static const unsigned usbvdat_c_1_pins[] = { AB9540_PIN_D18 };

#define AB9540_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins,		\
			.npins = ARRAY_SIZE(a##_pins), .altsetting = b }

static const struct abx500_pingroup ab9540_groups[] = {
	/* default column */
	AB9540_PIN_GROUP(sysclkreq2_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq3_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq4_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq6_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(gpio10_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(gpio11_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(gpio13_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(pwmout1_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(pwmout2_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(pwmout3_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(adi1_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(usbuicc_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq7_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq8_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(dmic12_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(dmic34_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(dmic56_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(extcpena_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(modsclsda_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(sysclkreq5_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(gpio50_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(batremn_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(resethw_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(service_d_1, ABX500_DEFAULT),
	AB9540_PIN_GROUP(gpio60_d_1, ABX500_DEFAULT),

	/* Altfunction A column */
	AB9540_PIN_GROUP(gpio1_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio2_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio3_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio4_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(hiqclkena_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(pdmclk_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(uartdata_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio14_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio15_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio16_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio17_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio18_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio19_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio20_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio21_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio22_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio23_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio24_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio25_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio27_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio28_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio29_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio30_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio31_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio32_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio34_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio40_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio41_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio42_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio51_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio52_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(gpio53_a_1, ABX500_ALT_A),
	AB9540_PIN_GROUP(usbuiccpd_a_1, ABX500_ALT_A),

	/* Altfunction B column */
	AB9540_PIN_GROUP(pdmdata_b_1, ABX500_ALT_B),
	AB9540_PIN_GROUP(pwmextvibra1_b_1, ABX500_ALT_B),
	AB9540_PIN_GROUP(pwmextvibra2_b_1, ABX500_ALT_B),

	/* Altfunction C column */
	AB9540_PIN_GROUP(usbvdat_c_1, ABX500_ALT_C),
};

/* We use this macro to define the groups applicable to a function */
#define AB9540_FUNC_GROUPS(a, b...)	   \
static const char * const a##_groups[] = { b };

AB9540_FUNC_GROUPS(sysclkreq, "sysclkreq2_d_1", "sysclkreq3_d_1",
		"sysclkreq4_d_1", "sysclkreq5_d_1", "sysclkreq6_d_1",
		"sysclkreq7_d_1", "sysclkreq8_d_1");
AB9540_FUNC_GROUPS(gpio, "gpio1_a_1", "gpio2_a_1", "gpio3_a_1", "gpio4_a_1",
		"gpio10_d_1", "gpio11_d_1", "gpio13_d_1", "gpio14_a_1",
		"gpio15_a_1", "gpio16_a_1", "gpio17_a_1", "gpio18_a_1",
		"gpio19_a_1", "gpio20_a_1", "gpio21_a_1", "gpio22_a_1",
		"gpio23_a_1", "gpio24_a_1", "gpio25_a_1", "gpio27_a_1",
		"gpio28_a_1", "gpio29_a_1", "gpio30_a_1", "gpio31_a_1",
		"gpio32_a_1", "gpio34_a_1", "gpio40_a_1", "gpio41_a_1",
		"gpio42_a_1", "gpio50_d_1", "gpio51_a_1", "gpio52_a_1",
		"gpio53_a_1", "gpio60_d_1");
AB9540_FUNC_GROUPS(pwmout, "pwmout1_d_1", "pwmout2_d_1", "pwmout3_d_1");
AB9540_FUNC_GROUPS(adi1, "adi1_d_1");
AB9540_FUNC_GROUPS(usbuicc, "usbuicc_d_1", "usbuiccpd_a_1");
AB9540_FUNC_GROUPS(dmic, "dmic12_d_1", "dmic34_d_1", "dmic56_d_1");
AB9540_FUNC_GROUPS(extcpena, "extcpena_d_1");
AB9540_FUNC_GROUPS(modsclsda, "modsclsda_d_1");
AB9540_FUNC_GROUPS(batremn, "batremn_d_1");
AB9540_FUNC_GROUPS(resethw, "resethw_d_1");
AB9540_FUNC_GROUPS(service, "service_d_1");
AB9540_FUNC_GROUPS(hiqclkena, "hiqclkena_a_1");
AB9540_FUNC_GROUPS(pdm, "pdmdata_b_1", "pdmclk_a_1");
AB9540_FUNC_GROUPS(uartdata, "uartdata_a_1");
AB9540_FUNC_GROUPS(pwmextvibra, "pwmextvibra1_b_1", "pwmextvibra2_b_1");
AB9540_FUNC_GROUPS(usbvdat, "usbvdat_c_1");

#define FUNCTION(fname)					\
	{						\
		.name = #fname,				\
		.groups = fname##_groups,		\
		.ngroups = ARRAY_SIZE(fname##_groups),	\
	}

static const struct abx500_function ab9540_functions[] = {
	FUNCTION(sysclkreq),
	FUNCTION(gpio),
	FUNCTION(pwmout),
	FUNCTION(adi1),
	FUNCTION(usbuicc),
	FUNCTION(dmic),
	FUNCTION(extcpena),
	FUNCTION(modsclsda),
	FUNCTION(batremn),
	FUNCTION(resethw),
	FUNCTION(service),
	FUNCTION(hiqclkena),
	FUNCTION(pdm),
	FUNCTION(uartdata),
	FUNCTION(pwmextvibra),
	FUNCTION(usbvdat),
};

/*
 * this table translates what's is in the AB9540 specification regarding the
 * balls alternate functions (as for DB, default, ALT_A, ALT_B and ALT_C).
 * ALTERNATE_FUNCTIONS(GPIO_NUMBER, GPIOSEL bit, ALTERNATFUNC bit1,
 * ALTERNATEFUNC bit2, ALTA val, ALTB val, ALTC val),
 *
 * example :
 *
 *	ALTERNATE_FUNCTIONS(13,     4,      3,      4, 1, 0, 2),
 *	means that pin AB9540_PIN_D18 (pin 13) supports 4 mux (default/ALT_A,
 *	ALT_B and ALT_C), so GPIOSEL and ALTERNATFUNC registers are used to
 *	select the mux. ALTA, ALTB and ALTC val indicates values to write in
 *	ALTERNATFUNC register. We need to specifies these values as SOC
 *	designers didn't apply the same logic on how to select mux in the
 *	ABx500 family.
 *
 *	As this pins supports at least ALT_B mux, default mux is
 *	selected by writing 1 in GPIOSEL bit :
 *
 *		| GPIOSEL bit=4 | alternatfunc bit2=4 | alternatfunc bit1=3
 *	default	|       1       |          0          |          0
 *	alt_A	|       0       |          0          |          1
 *	alt_B	|       0       |          0          |          0
 *	alt_C	|       0       |          1          |          0
 *
 *	ALTERNATE_FUNCTIONS(1,      0, UNUSED, UNUSED),
 *	means that pin AB9540_PIN_R4 (pin 1) supports 2 mux, so only GPIOSEL
 *	register is used to select the mux. As this pins doesn't support at
 *	least ALT_B mux, default mux is by writing 0 in GPIOSEL bit :
 *
 *		| GPIOSEL bit=0 | alternatfunc bit2=  | alternatfunc bit1=
 *	default	|       0       |          0          |          0
 *	alt_A	|       1       |          0          |          0
 */

static struct
alternate_functions ab9540alternate_functions[AB9540_GPIO_MAX_NUMBER + 1] = {
	/* GPIOSEL1 - bits 4-7 are reserved */
	ALTERNATE_FUNCTIONS(0, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO0 */
	ALTERNATE_FUNCTIONS(1,	    0, UNUSED, UNUSED, 0, 0, 0), /* GPIO1, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(2,      1, UNUSED, UNUSED, 0, 0, 0), /* GPIO2, altA controlled by bit 1 */
	ALTERNATE_FUNCTIONS(3,      2, UNUSED, UNUSED, 0, 0, 0), /* GPIO3, altA controlled by bit 2*/
	ALTERNATE_FUNCTIONS(4,      3, UNUSED, UNUSED, 0, 0, 0), /* GPIO4, altA controlled by bit 3*/
	ALTERNATE_FUNCTIONS(5, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO5 */
	ALTERNATE_FUNCTIONS(6, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO6 */
	ALTERNATE_FUNCTIONS(7, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO7 */
	ALTERNATE_FUNCTIONS(8, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO8 */
	/* GPIOSEL2 - bits 0 and 3 are reserved */
	ALTERNATE_FUNCTIONS(9, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO9 */
	ALTERNATE_FUNCTIONS(10,      1,      0, UNUSED, 1, 0, 0), /* GPIO10, altA and altB controlled by bit 0 */
	ALTERNATE_FUNCTIONS(11,      2,	     1, UNUSED, 0, 0, 0), /* GPIO11, altA controlled by bit 1 */
	ALTERNATE_FUNCTIONS(12, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO12 */
	ALTERNATE_FUNCTIONS(13,      4,      3,      4, 1, 0, 2), /* GPIO13, altA altB and altC controlled by bit 3 and 4 */
	ALTERNATE_FUNCTIONS(14,      5, UNUSED, UNUSED, 0, 0, 0), /* GPIO14, altA controlled by bit 5 */
	ALTERNATE_FUNCTIONS(15,      6, UNUSED, UNUSED, 0, 0, 0), /* GPIO15, altA controlled by bit 6 */
	ALTERNATE_FUNCTIONS(16,      7, UNUSED, UNUSED, 0, 0, 0), /* GPIO16, altA controlled by bit 7 */
	/* GPIOSEL3 - bit 1-3 reserved
	 * pins 17 to 20 are special case, only bit 0 is used to select
	 * alternate function for these 4 pins.
	 * bits 1 to 3 are reserved
	 */
	ALTERNATE_FUNCTIONS(17,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO17, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(18,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO18, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(19,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO19, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(20,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO20, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(21,      4, UNUSED, UNUSED, 0, 0, 0), /* GPIO21, altA controlled by bit 4 */
	ALTERNATE_FUNCTIONS(22,      5, UNUSED, UNUSED, 0, 0, 0), /* GPIO22, altA controlled by bit 5 */
	ALTERNATE_FUNCTIONS(23,      6, UNUSED, UNUSED, 0, 0, 0), /* GPIO23, altA controlled by bit 6 */
	ALTERNATE_FUNCTIONS(24,      7, UNUSED, UNUSED, 0, 0, 0), /* GPIO24, altA controlled by bit 7 */
	/* GPIOSEL4 - bit 1 reserved */
	ALTERNATE_FUNCTIONS(25,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO25, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(26, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO26 */
	ALTERNATE_FUNCTIONS(27,      2, UNUSED, UNUSED, 0, 0, 0), /* GPIO27, altA controlled by bit 2 */
	ALTERNATE_FUNCTIONS(28,      3, UNUSED, UNUSED, 0, 0, 0), /* GPIO28, altA controlled by bit 3 */
	ALTERNATE_FUNCTIONS(29,      4, UNUSED, UNUSED, 0, 0, 0), /* GPIO29, altA controlled by bit 4 */
	ALTERNATE_FUNCTIONS(30,      5, UNUSED, UNUSED, 0, 0, 0), /* GPIO30, altA controlled by bit 5 */
	ALTERNATE_FUNCTIONS(31,      6, UNUSED, UNUSED, 0, 0, 0), /* GPIO31, altA controlled by bit 6 */
	ALTERNATE_FUNCTIONS(32,      7, UNUSED, UNUSED, 0, 0, 0), /* GPIO32, altA controlled by bit 7 */
	/* GPIOSEL5 - bit 0, 2-6 are reserved */
	ALTERNATE_FUNCTIONS(33, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO33 */
	ALTERNATE_FUNCTIONS(34,      1, UNUSED, UNUSED, 0, 0, 0), /* GPIO34, altA controlled by bit 1 */
	ALTERNATE_FUNCTIONS(35, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO35 */
	ALTERNATE_FUNCTIONS(36, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO36 */
	ALTERNATE_FUNCTIONS(37, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO37 */
	ALTERNATE_FUNCTIONS(38, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO38 */
	ALTERNATE_FUNCTIONS(39, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO39 */
	ALTERNATE_FUNCTIONS(40,      7, UNUSED, UNUSED, 0, 0, 0), /* GPIO40, altA controlled by bit 7 */
	/* GPIOSEL6 - bit 2-7 are reserved */
	ALTERNATE_FUNCTIONS(41,      0, UNUSED, UNUSED, 0, 0, 0), /* GPIO41, altA controlled by bit 0 */
	ALTERNATE_FUNCTIONS(42,      1, UNUSED, UNUSED, 0, 0, 0), /* GPIO42, altA controlled by bit 1 */
	ALTERNATE_FUNCTIONS(43, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO43 */
	ALTERNATE_FUNCTIONS(44, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO44 */
	ALTERNATE_FUNCTIONS(45, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO45 */
	ALTERNATE_FUNCTIONS(46, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO46 */
	ALTERNATE_FUNCTIONS(47, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO47 */
	ALTERNATE_FUNCTIONS(48, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO48 */
	/*
	 * GPIOSEL7 - bit 0 and 6-7 are reserved
	 * special case with GPIO60, wich is located at offset 5 of gpiosel7
	 * don't know why it has been called GPIO60 in AB9540 datasheet,
	 * GPIO54 would be logical..., so at SOC point of view we consider
	 * GPIO60 = GPIO54
	 */
	ALTERNATE_FUNCTIONS(49,      0, UNUSED, UNUSED, 0, 0, 0), /* no GPIO49 */
	ALTERNATE_FUNCTIONS(50,      1,	     2, UNUSED, 1, 0, 0), /* GPIO50, altA and altB controlled by bit 1 */
	ALTERNATE_FUNCTIONS(51,	     2, UNUSED, UNUSED, 0, 0, 0), /* GPIO51, altA controlled by bit 2 */
	ALTERNATE_FUNCTIONS(52,      3, UNUSED, UNUSED, 0, 0, 0), /* GPIO52, altA controlled by bit 3 */
	ALTERNATE_FUNCTIONS(53,	     4, UNUSED, UNUSED, 0, 0, 0), /* GPIO53, altA controlled by bit 4 */
	ALTERNATE_FUNCTIONS(54,	     5, UNUSED, UNUSED, 0, 0, 0), /* GPIO54 = GPIO60, altA controlled by bit 5 */
};

static struct abx500_gpio_irq_cluster ab9540_gpio_irq_cluster[] = {
	GPIO_IRQ_CLUSTER(10, 13, AB8500_INT_GPIO10R),
	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
	GPIO_IRQ_CLUSTER(40, 41, AB8500_INT_GPIO40R),
	GPIO_IRQ_CLUSTER(50, 54, AB9540_INT_GPIO50R),
};

static struct abx500_pinctrl_soc_data ab9540_soc = {
	.gpio_ranges = ab9540_pinranges,
	.gpio_num_ranges = ARRAY_SIZE(ab9540_pinranges),
	.pins = ab9540_pins,
	.npins = ARRAY_SIZE(ab9540_pins),
	.functions = ab9540_functions,
	.nfunctions = ARRAY_SIZE(ab9540_functions),
	.groups = ab9540_groups,
	.ngroups = ARRAY_SIZE(ab9540_groups),
	.alternate_functions = ab9540alternate_functions,
	.gpio_irq_cluster = ab9540_gpio_irq_cluster,
	.ngpio_irq_cluster = ARRAY_SIZE(ab9540_gpio_irq_cluster),
	.irq_gpio_rising_offset = AB8500_INT_GPIO6R,
	.irq_gpio_falling_offset = AB8500_INT_GPIO6F,
	.irq_gpio_factor = 1,
};

void
abx500_pinctrl_ab9540_init(struct abx500_pinctrl_soc_data **soc)
{
	*soc = &ab9540_soc;
}