Skip to content

Commit

Permalink
Merge branch 'next' of git://git.denx.de/linux-denx-agust into next
Browse files Browse the repository at this point in the history
MPC5xxx updates from Anatolij:

"Highlights include a driver for MPC512x LocalPlus Bus FIFO with its
device tree binding documentation, mpc512x device tree updates and some
minor fixes."
  • Loading branch information
mpe committed Nov 5, 2015
2 parents 3b0e21e + 39e69f5 commit 8bdf202
Show file tree
Hide file tree
Showing 11 changed files with 650 additions and 9 deletions.
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Freescale MPC512x LocalPlus Bus FIFO (called SCLPC in the Reference Manual)

Required properties:
- compatible: should be "fsl,mpc512x-lpbfifo";
- reg: should contain the offset and length of SCLPC register set;
- interrupts: should contain the interrupt specifier for SCLPC; syntax of an
interrupt client node is described in interrupt-controller/interrupts.txt;
- dmas: should contain the DMA specifier for SCLPC as described at
dma/dma.txt and dma/mpc512x-dma.txt;
- dma-names: should be "rx-tx";

Example:

sclpc@10100 {
compatible = "fsl,mpc512x-lpbfifo";
reg = <0x10100 0x50>;
interrupts = <7 0x8>;
dmas = <&dma0 26>;
dma-names = "rx-tx";
};

11 changes: 9 additions & 2 deletions arch/powerpc/boot/dts/mpc5121.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
#address-cells = <2>;
#size-cells = <1>;
reg = <0x80000020 0x40>;
interrupts = <7 0x8>;
ranges = <0x0 0x0 0xfc000000 0x04000000>;
};

Expand Down Expand Up @@ -329,7 +328,15 @@
/* LocalPlus controller */
lpc@10000 {
compatible = "fsl,mpc5121-lpc";
reg = <0x10000 0x200>;
reg = <0x10000 0x100>;
};

sclpc@10100 {
compatible = "fsl,mpc512x-lpbfifo";
reg = <0x10100 0x50>;
interrupts = <7 0x8>;
dmas = <&dma0 26>;
dma-names = "rx-tx";
};

pata@10200 {
Expand Down
11 changes: 10 additions & 1 deletion arch/powerpc/boot/dts/mpc5125twr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@
status = "disabled";
};

sclpc@10100 {
compatible = "fsl,mpc512x-lpbfifo";
reg = <0x10100 0x50>;
interrupts = <7 0x8>;
dmas = <&dma0 26>;
dma-names = "rx-tx";
};

// 5125 PSCs are not 52xx or 5121 PSC compatible
// PSC1 uart0 aka ttyPSC0
serial@11100 {
Expand Down Expand Up @@ -279,10 +287,11 @@
clock-names = "ipg";
};

dma@14000 {
dma0: dma@14000 {
compatible = "fsl,mpc5121-dma"; // BSP name: "mpc512x-dma2"
reg = <0x14000 0x1800>;
interrupts = <65 0x8>;
#dma-cells = <1>;
};
};
};
1 change: 1 addition & 0 deletions arch/powerpc/configs/mpc512x_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ CONFIG_RTC_DRV_M41T80=y
CONFIG_RTC_DRV_MPC5121=y
CONFIG_DMADEVICES=y
CONFIG_MPC512X_DMA=y
CONFIG_MPC512x_LPBFIFO=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XIP=y
CONFIG_EXT3_FS=y
Expand Down
59 changes: 59 additions & 0 deletions arch/powerpc/include/asm/mpc5121.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,63 @@ struct mpc512x_lpc {

int mpc512x_cs_config(unsigned int cs, u32 val);

/*
* SCLPC Module (LPB FIFO)
*/
struct mpc512x_lpbfifo {
u32 pkt_size; /* SCLPC Packet Size Register */
u32 start_addr; /* SCLPC Start Address Register */
u32 ctrl; /* SCLPC Control Register */
u32 enable; /* SCLPC Enable Register */
u32 reserved1;
u32 status; /* SCLPC Status Register */
u32 bytes_done; /* SCLPC Bytes Done Register */
u32 emb_sc; /* EMB Share Counter Register */
u32 emb_pc; /* EMB Pause Control Register */
u32 reserved2[7];
u32 data_word; /* LPC RX/TX FIFO Data Word Register */
u32 fifo_status; /* LPC RX/TX FIFO Status Register */
u32 fifo_ctrl; /* LPC RX/TX FIFO Control Register */
u32 fifo_alarm; /* LPC RX/TX FIFO Alarm Register */
};

#define MPC512X_SCLPC_START (1 << 31)
#define MPC512X_SCLPC_CS(x) (((x) & 0x7) << 24)
#define MPC512X_SCLPC_FLUSH (1 << 17)
#define MPC512X_SCLPC_READ (1 << 16)
#define MPC512X_SCLPC_DAI (1 << 8)
#define MPC512X_SCLPC_BPT(x) ((x) & 0x3f)
#define MPC512X_SCLPC_RESET (1 << 24)
#define MPC512X_SCLPC_FIFO_RESET (1 << 16)
#define MPC512X_SCLPC_ABORT_INT_ENABLE (1 << 9)
#define MPC512X_SCLPC_NORM_INT_ENABLE (1 << 8)
#define MPC512X_SCLPC_ENABLE (1 << 0)
#define MPC512X_SCLPC_SUCCESS (1 << 24)
#define MPC512X_SCLPC_FIFO_CTRL(x) (((x) & 0x7) << 24)
#define MPC512X_SCLPC_FIFO_ALARM(x) ((x) & 0x3ff)

enum lpb_dev_portsize {
LPB_DEV_PORTSIZE_UNDEFINED = 0,
LPB_DEV_PORTSIZE_1_BYTE = 1,
LPB_DEV_PORTSIZE_2_BYTES = 2,
LPB_DEV_PORTSIZE_4_BYTES = 4,
LPB_DEV_PORTSIZE_8_BYTES = 8
};

enum mpc512x_lpbfifo_req_dir {
MPC512X_LPBFIFO_REQ_DIR_READ,
MPC512X_LPBFIFO_REQ_DIR_WRITE
};

struct mpc512x_lpbfifo_request {
phys_addr_t dev_phys_addr; /* physical address of some device on LPB */
void *ram_virt_addr; /* virtual address of some region in RAM */
u32 size;
enum lpb_dev_portsize portsize;
enum mpc512x_lpbfifo_req_dir dir;
void (*callback)(struct mpc512x_lpbfifo_request *);
};

int mpc512x_lpbfifo_submit(struct mpc512x_lpbfifo_request *req);

#endif /* __ASM_POWERPC_MPC5121_H__ */
2 changes: 0 additions & 2 deletions arch/powerpc/include/asm/mpc52xx_psc.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ struct mpc52xx_psc_fifo {
#define MPC512x_PSC_FIFO_FULL 0x2
#define MPC512x_PSC_FIFO_ALARM 0x4
#define MPC512x_PSC_FIFO_URERR 0x8
#define MPC512x_PSC_FIFO_ORERR 0x01
#define MPC512x_PSC_FIFO_MEMERROR 0x02

struct mpc512x_psc_fifo {
u32 reserved1[10];
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/platforms/512x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ config PPC_MPC512x
select USB_EHCI_BIG_ENDIAN_MMIO if USB_EHCI_HCD
select USB_EHCI_BIG_ENDIAN_DESC if USB_EHCI_HCD

config MPC512x_LPBFIFO
tristate "MPC512x LocalPlus Bus FIFO driver"
depends on PPC_MPC512x && MPC512X_DMA
help
Enable support for Freescale MPC512x LocalPlus Bus FIFO (SCLPC).

config MPC5121_ADS
bool "Freescale MPC5121E ADS"
depends on PPC_MPC512x
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/512x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ obj-$(CONFIG_COMMON_CLK) += clock-commonclk.o
obj-y += mpc512x_shared.o
obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o mpc5121_ads_cpld.o
obj-$(CONFIG_MPC512x_GENERIC) += mpc512x_generic.o
obj-$(CONFIG_MPC512x_LPBFIFO) += mpc512x_lpbfifo.o
obj-$(CONFIG_PDM360NG) += pdm360ng.o
Loading

0 comments on commit 8bdf202

Please sign in to comment.