sunxi: add sunxi_is_${soc_name}() macros

supporting all known sun4i and sun5i SoCs.
- sunxi_is_a10()
- sunxi_is_a13()
- sunxi_is_a12()
- sunxi_is_a10s()

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi: implement sw_get_chip_id()

from latest sun[45]i SDK

Signed-off-by: Alejandro Mery <amery@geeks.cl>
SUN5I GPIO EINT definition and fix to irq search function

This patch fix the break condition in "sunxi_find_gpio_irq" to prevent the early stop of the search in the "gpio_eint_list".
If the EINT enumeration is discontinuous it could happen that some elements in the list are empty, but the search must go on until the scan of the list is complete, without stopping at the first not-defined EINT.
For example, as defined in "gpio-sunxi.h" patch, SUN5I arch has only some of the 32 interrupts available, but the enumeration is not continuous. This is not a problem in the SUN4I which has all the 0-31 interrupts defined.

EINT_NUM definition in "gpio-sunxi.h" is 32 because there are 4 8-bit registers for interrupts configuration, so it should be reasonable that the interrupt layout of SUN5I is simlar to SUN4I with only some irqs enable.

Signed-off-by: Lorenzo Nava <lorenx4@gmail.com>
sunxi:soc-detect: mark sw_get_ic_ver() as pure

Signed-off-by: Alejandro Mery <amery@geeks.cl>
gpio:sunxi: move eint table within the .c and using sunxi_is_foo()

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi: bring sunxi_pr_chip_id() back, but using the ic_ver

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: rename sunxi_chip_id() to sunxi_brom_chip_id()

because there are other methods

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: export sunxi_brom_chip_id()

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi: introduce SUNXI_MACH_SUNnI defines using Allwinner's chipid values
sunxi:soc-detect: introduce sunxi_sramc_chip_id()

Thanks to hno's discovery

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: add cached/pure sunxi_chip_id() and sunxi_is_sunNi() macros

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: add extra debugging to sw_get_ic_ver() errors
sunxi:soc-detect: fix copy&paste mistake
sunxi:soc-detect: remove CONFIG_ARCH_SUNnI optimization

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: dump SSE_IO_REG0 when failed to detect SoC too
sunxi:soc-detect: clean register dumping code

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: fix sw_get_ic_ver/sun5i bug

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: add basic sun6i/A31 detection

Thanks to drachensun

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi:soc-detect: refactored SUNXI_VER_ values into something more useful

Signed-off-by: Alejandro Mery <amery@geeks.cl>