Skip to content

Commit

Permalink
Merge branch 'lantiq' of git://dev.phrozen.org/mips-next into mips-fo…
Browse files Browse the repository at this point in the history
…r-linux-next
  • Loading branch information
Ralf Baechle committed Sep 27, 2012
2 parents e33fd70 + c9e854c commit 35a041e
Show file tree
Hide file tree
Showing 22 changed files with 2,272 additions and 221 deletions.
83 changes: 83 additions & 0 deletions Documentation/devicetree/bindings/pinctrl/lantiq,falcon-pinumx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Lantiq FALCON pinmux controller

Required properties:
- compatible: "lantiq,pinctrl-falcon"
- reg: Should contain the physical address and length of the gpio/pinmux
register range

Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".

Lantiq's pin configuration nodes act as a container for an abitrary number of
subnodes. Each of these subnodes represents some desired configuration for a
pin, a group, or a list of pins or groups. This configuration can include the
mux function to select on those group(s), and two pin configuration parameters:
pull-up and open-drain

The name of each subnode is not important as long as it is unique; all subnodes
should be enumerated and processed purely based on their content.

Each subnode only affects those parameters that are explicitly listed. In
other words, a subnode that lists a mux function but no pin configuration
parameters implies no information about any pin configuration parameters.
Similarly, a pin subnode that describes a pullup parameter implies no
information about e.g. the mux function.

We support 2 types of nodes.

Definition of mux function groups:

Required subnode-properties:
- lantiq,groups : An array of strings. Each string contains the name of a group.
Valid values for these names are listed below.
- lantiq,function: A string containing the name of the function to mux to the
group. Valid values for function names are listed below.

Valid values for group and function names:

mux groups:
por, ntr, ntr8k, hrst, mdio, bootled, asc0, spi, spi cs0, spi cs1, i2c,
jtag, slic, pcm, asc1

functions:
rst, ntr, mdio, led, asc, spi, i2c, jtag, slic, pcm


Definition of pin configurations:

Required subnode-properties:
- lantiq,pins : An array of strings. Each string contains the name of a pin.
Valid values for these names are listed below.

Optional subnode-properties:
- lantiq,pull: Integer, representing the pull-down/up to apply to the pin.
0: none, 1: down
- lantiq,drive-current: Boolean, enables drive-current
- lantiq,slew-rate: Boolean, enables slew-rate

Example:
pinmux0 {
compatible = "lantiq,pinctrl-falcon";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;

state_default: pinmux {
asc0 {
lantiq,groups = "asc0";
lantiq,function = "asc";
};
ntr {
lantiq,groups = "ntr8k";
lantiq,function = "ntr";
};
i2c {
lantiq,groups = "i2c";
lantiq,function = "i2c";
};
hrst {
lantiq,groups = "hrst";
lantiq,function = "rst";
};
};
};
97 changes: 97 additions & 0 deletions Documentation/devicetree/bindings/pinctrl/lantiq,xway-pinumx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Lantiq XWAY pinmux controller

Required properties:
- compatible: "lantiq,pinctrl-xway" or "lantiq,pinctrl-xr9"
- reg: Should contain the physical address and length of the gpio/pinmux
register range

Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".

Lantiq's pin configuration nodes act as a container for an abitrary number of
subnodes. Each of these subnodes represents some desired configuration for a
pin, a group, or a list of pins or groups. This configuration can include the
mux function to select on those group(s), and two pin configuration parameters:
pull-up and open-drain

The name of each subnode is not important as long as it is unique; all subnodes
should be enumerated and processed purely based on their content.

Each subnode only affects those parameters that are explicitly listed. In
other words, a subnode that lists a mux function but no pin configuration
parameters implies no information about any pin configuration parameters.
Similarly, a pin subnode that describes a pullup parameter implies no
information about e.g. the mux function.

We support 2 types of nodes.

Definition of mux function groups:

Required subnode-properties:
- lantiq,groups : An array of strings. Each string contains the name of a group.
Valid values for these names are listed below.
- lantiq,function: A string containing the name of the function to mux to the
group. Valid values for function names are listed below.

Valid values for group and function names:

mux groups:
exin0, exin1, exin2, jtag, ebu a23, ebu a24, ebu a25, ebu clk, ebu cs1,
ebu wait, nand ale, nand cs1, nand cle, spi, spi_cs1, spi_cs2, spi_cs3,
spi_cs4, spi_cs5, spi_cs6, asc0, asc0 cts rts, stp, nmi , gpt1, gpt2,
gpt3, clkout0, clkout1, clkout2, clkout3, gnt1, gnt2, gnt3, req1, req2,
req3

additional mux groups (XR9 only):
mdio, nand rdy, nand rd, exin3, exin4, gnt4, req4

functions:
spi, asc, cgu, jtag, exin, stp, gpt, nmi, pci, ebu, mdio



Definition of pin configurations:

Required subnode-properties:
- lantiq,pins : An array of strings. Each string contains the name of a pin.
Valid values for these names are listed below.

Optional subnode-properties:
- lantiq,pull: Integer, representing the pull-down/up to apply to the pin.
0: none, 1: down, 2: up.
- lantiq,open-drain: Boolean, enables open-drain on the defined pin.

Valid values for XWAY pin names:
Pinconf pins can be referenced via the names io0-io31.

Valid values for XR9 pin names:
Pinconf pins can be referenced via the names io0-io55.

Example:
gpio: pinmux@E100B10 {
compatible = "lantiq,pinctrl-xway";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;

#gpio-cells = <2>;
gpio-controller;
reg = <0xE100B10 0xA0>;

state_default: pinmux {
stp {
lantiq,groups = "stp";
lantiq,function = "stp";
};
pci {
lantiq,groups = "gnt1";
lantiq,function = "pci";
};
conf_out {
lantiq,pins = "io4", "io5", "io6"; /* stp */
lantiq,open-drain;
lantiq,pull = <0>;
};
};
};

2 changes: 2 additions & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ config LANTIQ
select HAVE_MACH_CLKDEV
select CLKDEV_LOOKUP
select USE_OF
select PINCTRL
select PINCTRL_LANTIQ

config LASAT
bool "LASAT Networks platforms"
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/include/asm/mach-lantiq/falcon/falcon_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@

#define MIPS_CPU_TIMER_IRQ 7

#define MAX_IM 5

#endif /* _FALCON_IRQ__ */
4 changes: 4 additions & 0 deletions arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ extern __iomem void *ltq_sys1_membase;
#define ltq_sys1_w32_mask(clear, set, reg) \
ltq_sys1_w32((ltq_sys1_r32(reg) & ~(clear)) | (set), reg)

/* allow the gpio and pinctrl drivers to talk to eachother */
extern int pinctrl_falcon_get_range_size(int id);
extern void pinctrl_falcon_add_gpio_range(struct pinctrl_gpio_range *range);

/*
* to keep the irq code generic we need to define this to 0 as falcon
* has no EIU/EBU
Expand Down
5 changes: 1 addition & 4 deletions arch/mips/include/asm/mach-lantiq/gpio.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef __ASM_MIPS_MACH_LANTIQ_GPIO_H
#define __ASM_MIPS_MACH_LANTIQ_GPIO_H

static inline int gpio_to_irq(unsigned int gpio)
{
return -1;
}
#define gpio_to_irq __gpio_to_irq

#define gpio_get_value __gpio_get_value
#define gpio_set_value __gpio_set_value
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

#define MIPS_CPU_TIMER_IRQ 7

#define MAX_IM 5

#endif
2 changes: 2 additions & 0 deletions arch/mips/lantiq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if LANTIQ

config SOC_TYPE_XWAY
bool
select PINCTRL_XWAY
default n

choice
Expand All @@ -19,6 +20,7 @@ config SOC_XWAY

config SOC_FALCON
bool "FALCON"
select PINCTRL_FALCON

endchoice

Expand Down
5 changes: 5 additions & 0 deletions arch/mips/lantiq/falcon/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/

#include <linux/kernel.h>
#include <asm/cacheflush.h>
#include <asm/traps.h>
#include <asm/io.h>

#include <lantiq_soc.h>
Expand Down Expand Up @@ -84,4 +86,7 @@ void __init ltq_soc_detect(struct ltq_soc_info *i)
unreachable();
break;
}

board_nmi_handler_setup = ltq_soc_nmi_setup;
board_ejtag_handler_setup = ltq_soc_ejtag_setup;
}
1 change: 1 addition & 0 deletions arch/mips/lantiq/falcon/sysctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ static inline void clkdev_add_sys(const char *dev, unsigned int module,
clk->cl.con_id = NULL;
clk->cl.clk = clk;
clk->module = module;
clk->bits = bits;
clk->activate = sysctl_activate;
clk->deactivate = sysctl_deactivate;
clk->enable = sysctl_clken;
Expand Down
Loading

0 comments on commit 35a041e

Please sign in to comment.