FogBugz #184641: Remove unused define

SOCFPGA_IRQ_GIC_START is not used for anything. Remove it.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #184646: Turn on all peripheral clocks for a system reboot

When doing a software reboot, all peripheral clocks must get turned on for the
L3 interconnect to work.

This code is needed when doing a "reboot" from user-space and a peripheral
clock as been gated off. Why would a peripheral clock get gated? An example
use case would be a .ko that gets insmod and rmmod during runtime. The insmod
would turn on the IP's clock, and the rmmod would turn off the IP's clock.
Doing a "reboot" would cause the system to hang.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #184715: nios2: irq: s/unsigned/u32

Usage of 'unsigned' with implicit type is frowned upon so let's
replace it with 'u32'.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #178225: Add Altera interrupt latency counter driver

Adding Altera interrupt latency counter driver support. This driver works
together with the Altera interrupt latency driver soft IP to measure the
time from the interrupt being asserted to the execution of the interrupt
service routine. This driver and soft ip supports for both edge and level
interrupt.

V2:
- Update fifo-depth property name in device tree
- Update binding document to add sysfs path and use case
- Update includes header in alphabetical order
- Remove global variables
- Rename kfifo stucts naming to avoid confusion
- Validate offset return value
- Changing read and write register functions
- Update on misc coding styles and format

V3:
- Update coding styles
- Update irq_request function
- Changing print out to dev_dbg() in ISR
- Fix ISR return values

V4:
- Remove stray line

Signed-off-by: Phoon Chee Nouk <cnphoon@altera.com>
FogBugz #185226: nios2: Simplify current_thread_info() implementation

This commit replaces the assembler implementation by a more
readable and equivalent pure-C implementation.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #184650: Cleanup Altera license headers.

A few files have incorrect headers and some files do not have
any headers. The biggest issue is that some files say "GPLv2 or
later". The "or later" part is the problem.

V2:
Remove asterisks from date.
Correct lower portion of header

Signed-off-by: Thor Thayer <tthayer@altera.com>
FogBugz #183948: Fix Nios II build failure

GPIO Altera driver uses writel_relaxed, which doesn't exist in nios2 io.h.
This is to add the _relaxed function to io.h.

Signed-off-by: Tien Hock Loh <thloh@altera.com>
FogBugz #186973: nios2: Fix warning from cacheflush.h

Fixed this warning by adding <linux/mm_types.h> and remove unused
cacheflush.h in process.c.

Example warning message:
arch/nios2/include/asm/cacheflush.h:21:2: warning:
'struct vm_area_struct' declared inside parameter list

Signed-off-by: Ley Foon Tan <lftan@altera.com>
FogBugz #187411: Add TSE MSGDMA and SGMDA Hybrid Driver

This commit adds the TSE MSGDMA and SGDMA hybrid driver. The
driver checks the device tree bindings compatibility string
to determine what mode the driver is operating in, and
probes the device tree for required resources accordingly.
SGDMA will be deprecated very soon by Altera, but is still
supported in this driver for customers that still use SGDMA.
The driver serves as a good example of how to use two
different types of soft DMA IP. The driver was tested on
ARM and NIOS systems, and issues specific to those systems
are handled by the driver such as misaligned exceptions on
the NIOS processor.

V3:
- Remove maintainer changes
- Correct git commit log line lengths

V2:
- Update per Crucible review 596
- Update bindings descriptions altera_tse.txt per review comments
- Changed altera_tse_driver to alteratse in Makefile and Kconfig
- Added entry in the Maintainers file
- changed altera_sgdmahw.h to use BIT macro instead of like (1<<0)
- corrected copyrights per review comments
- moved cacheflush.h to bottom of header inclusions in altera_tse.c
- use apis to extract lower and upper 32 bits of dma addresss
- remove barriers since dma apis ensure memory consistency
- add max-frame-size property
- change platform id from AVALON to "platform"
- use of function of_get_phy_mode instead of custom function
- remove use of netif_carrier_off, not needed in driver
- move probing of phy from open to the probe function

Signed-off-by: Vince Bridgers <vbridger@altera.com>
FogBugz #186724: Add backwards compatible binding for dw_apb_timer

In order to have the 3.10-ltsi kernel use the same DTS as the 3.13
kernel, we need to add the old compatibility string for the dw_apb_timer.
The 3.10 kernel was using the ""snps,dw-apb-timer-sp" and
"snps,dw-apb-timer-osc" compatible strings for the timers.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #188457: Fix DTS entries for SOCFPGA Arria V

The Arria V devkit has not been able to boot since v3.12 kernel. Turns out
that the device tree entries for arria5 has not been updated.

Update the socfpga_arria5.dtsi and socfpga_arria5_socdk.dts to have all the
correct onboard peripherals.

Also update the copyrights.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
---
v2:
- Update rxc-skew-ps to be 3000
- Update master-ref-clk to be 370MHz
FogBugz #189684-1: Enhance QSPI driver to use common clock framework

Modify the QSPI driver so that it can get the clock from the DTS entry and
use the clock driver to get the correct clock rate.

Also update the GPLv2 license.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #189684-2: dts part: clean up QSPI entries

Moves the base QSPI dts entry into socfpga.dtsi and add board specific QSPI
entry to the appropriate board file DTS files.

Removes the hard-coded clock frequency.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #189696: Remove socfpga_arria5.dts file

For the SOCFPGA Arria V devkit, the DTS flow would be:
socfpga_arria5.dtsi -> socfpga_arria5_socdk.dts.

The socfpga_arria.dts file is not used anymore.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
FogBugz #188963: Remove unused function stmmac_hw_setup

Looks like a recent modification modified the initialization sequence
and introduced a kernel build warning as a result. This patch removes
the unused function to avoid the kernel build warning.

Signed-off-by: Vince Bridgers <vbridger@altera.com>
FogBugz #189737: Check phy connect return codes when initializing phy

The phy initialization code should check the results of of_phy_connect
and connect_local_phy in the init_phy routine. This was caught during
community review.

Signed-off-by: Vince Bridgers <vbridger@altera.com>
FogBugz #189738: Correct code to obtain mdio child node from devicetree

The code to obtain the mdio child node accidentally worked for the
devicetree used for testing, and was incorrect for arbitrary devicetrees.
This patch corrects that problem found during community review.

Signed-off-by: Vince Bridgers <vbridger@altera.com>