FogBugz #193935: Fixed warnings during nios2 kernel compilation

Used generic posix_type.h. Integrated commit in 3.13 branch
(commit 0cd401716fa25)

Example warnings:
fs/jffs2/read.c:47:3: warning: format '%zx' expects argument of type
'size_t', but argument 4 has type 'long unsigned int' [-Wformat]

Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #194567: nios2: Remove duplicated setup.h

Integrate change from socfpga-3.13 branch, commit 0cd401716fa25.
Duplicated with arch/nios2/include/asm/setup.h.

Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #194889: nios2: Export symbol __muldi3

make modules TSE drivers have this error:
ERROR: "__muldi3" [drivers/net/ethernet/altera/altera_tse.ko] undefined!

__muldi3 is a function in libgcc.a. So, we need to export this symbol
for loadable module to use.

Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #194497: mailbox: Fixed compilation warning

Compilation warning when compiling for x86_64.
config: make ARCH=x86_64 allmodconfig
drivers/mailbox/mailbox-altera.c:337:3: warning:
format '%d' expects argument of type 'int', but
argument 3 has type 'long unsigned int' [-Wformat=]

v2:
- Change to use %zu

Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #194611: Configure I2C SDA and SCL parameters

This patch slows down the i2c frequency from 100khz to 50khz to
make the LCD work

v2:
rebased to new dts changes
fixed falling time values and verified with logical analyzer

v3:
migrated to 3.10 ltsi branch

Signed-off-by: Chris Rauer <crauer@altera.com>
Revert "FogBugz #189738: Correct code to obtain mdio child node from devicetree"

This reverts commit bd9d1aae1d420f35775d7f38b5e6863169216274.
Revert "FogBugz #189737: Check phy connect return codes when initializing phy"

This reverts commit 277780bc7bc427fdddb0145e9c44ce8b9ab38c76.
Revert "FogBugz #187411: Add TSE MSGDMA and SGMDA Hybrid Driver"

This reverts commit a02fb5c47924fadaf2c4be57eedae730db1a5279.
Revert "FogBugz #173677: TSE v2 Code Drop from GlobalLogic"

This reverts commit 64cb6b3fec0270531d253757bf8deee3f4cd31d9.
Revert "FogBugz #125125: driver/net: Add Altera TSE driver"

This reverts commit 55cab89bd2f44639d8cba998122aa9c6b435af31.
dts: Add bindings for the Altera Triple Speed Ethernet driver

This patch adds a bindings description for the Altera Triple Speed Ethernet
(TSE) driver. The bindings support the legacy SGDMA soft IP as well as the
preferred MSGDMA soft IP. The TSE can be configured and synthesized in soft
logic using Altera's Quartus toolchain. Please consult the bindings document
for supported options.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Add Altera Ethernet Driver MSGDMA File Components

This patch adds the MSGDMA soft IP support for the Altera Triple
Speed Ethernet driver.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Add Altera Ethernet Driver SGDMA file components

This patch adds the SGDMA soft IP support for the Altera Triple
Speed Ethernet driver.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Add Miscellaneous Files for Altera Ethernet Driver

This patch adds miscellaneous files for the Altera Ethernet Driver,
including ethtool support.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Add main and header file for Altera Ethernet Driver

This patch adds the main driver and header file for the Altera Triple
Speed Ethernet driver.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Add Altera Ethernet Driver Makefile and Kconfig

This patch adds the Altera Triple Speed Ethernet Makfile and
Kconfig file.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Set version number by driver's get regs

Set the version number returned by the driver's get regs routine
invoked by ethtool so formatting can be dependent on the version
number returned, and any interesting formatted output can check
the version number for specific types of register data returned.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Correct typecast issue detected by kbuild test robot

This patch addresses a portable pointer arithmetic issue in the
original submission found by the kbuild test robot.

config: make ARCH=i386 allyesconfig

   altera_sgdma.c: In function 'sgdma_txphysaddr':
>> altera_sgdma.c:393:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
     dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
                                    ^
>> altera_sgdma.c:394:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
        (dma_addr_t)priv->tx_dma_desc);
        ^
   altera_sgdma.c: In function 'sgdma_rxphysaddr':
>> altera_sgdma.c:403:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
     dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
                                    ^
>> altera_sgdma.c:404:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
        (dma_addr_t)priv->rx_dma_desc);
        ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Altera TSE: Correct two typos in original submission

This patch addresses two typos in the original driver submission. One derived
from a cut & paste error, and another is a misspelling.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
altera: Remove casts of pointer to same type

Casting a pointer to a pointer of the same type is pointless,
so remove these unnecessary casts.

Done via coccinelle script:

$ cat typecast_2.cocci
@@
type T;
T *foo;
@@

-	(T *)foo
+	foo

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>