diff --git a/arch/arm/cpu/armv7/qca/ipq806x/Kconfig b/arch/arm/cpu/armv7/qca/ipq806x/Kconfig new file mode 100644 index 0000000000..2e116e38fa --- /dev/null +++ b/arch/arm/cpu/armv7/qca/ipq806x/Kconfig @@ -0,0 +1,3 @@ +config ARCH_IPQ806x + bool "QCA IPQ806x SPECIFIC IPs" + diff --git a/arch/arm/cpu/armv7/qca/ipq806x/Makefile b/arch/arm/cpu/armv7/qca/ipq806x/Makefile new file mode 100644 index 0000000000..c3c3a93712 --- /dev/null +++ b/arch/arm/cpu/armv7/qca/ipq806x/Makefile @@ -0,0 +1,4 @@ +ccflags-y += -I$(srctree)/board/qca/ipq806x/ + +obj-y += clock.o +obj-y += gpio.o diff --git a/arch/arm/dts/ipq806x-ap148.dts b/arch/arm/dts/ipq806x-ap148.dts new file mode 100644 index 0000000000..9377a6542d --- /dev/null +++ b/arch/arm/dts/ipq806x-ap148.dts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/dts-v1/; +#include "ipq806x-soc.dtsi" +/ { + model ="QCA, IPQ806x-AK01"; + compatible = "qca,ipq806x", "qca,ipq806x-ak01"; + machid = <0x00000000>; + aliases { + console = "/serial@16340000"; + }; +}; + diff --git a/arch/arm/dts/ipq806x-soc.dtsi b/arch/arm/dts/ipq806x-soc.dtsi new file mode 100644 index 0000000000..45d0cece4f --- /dev/null +++ b/arch/arm/dts/ipq806x-soc.dtsi @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "skeleton.dtsi" + +/ { + + serial@16340000 { + compatible = "qca,ipq-uartdm"; + reg = <0x16340000 0x200>; + gsbi_base = <0x16300000>; + id = <2>; + bit_rate = <0xCC>; + }; + + timer { + gcnt_en = <0x0200A00C>; + gcnt_cnt = <0x0200A008>; + gpt_freq_hz = <32000>; + timer_load_val = <0x00FFFFFF 0xFFFFFFFF>; + }; + +}; + diff --git a/board/ipq806x/Kconfig b/board/ipq806x/Kconfig new file mode 100644 index 0000000000..6de4e07519 --- /dev/null +++ b/board/ipq806x/Kconfig @@ -0,0 +1,15 @@ +if ARCH_IPQ806x + +config SYS_CPU + default "ipq806x" + +config SYS_BOARD + default "ipq806x" + +config SYS_VENDOR + default "qca" + +config SYS_CONFIG_NAME + default "ipq806x" + +endif diff --git a/board/qca/ipq806x/Makefile b/board/qca/ipq806x/Makefile new file mode 100644 index 0000000000..2398548137 --- /dev/null +++ b/board/qca/ipq806x/Makefile @@ -0,0 +1,3 @@ + +obj-y := ipq806x.o + diff --git a/board/qca/ipq806x/ipq806x.c b/board/qca/ipq806x/ipq806x.c new file mode 100644 index 0000000000..7eb6b37091 --- /dev/null +++ b/board/qca/ipq806x/ipq806x.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include + +#include "ipq806x.h" +#include "../common/qca_common.h" + +DECLARE_GLOBAL_DATA_PTR; + +qca_mmc mmc_host; + +void enable_caches(void) +{ + icache_enable(); +} + +void disable_caches(void) +{ + icache_disable(); +} + + +int board_init(void) +{ + return 0; +} + +int dram_init(void) +{ + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +} + +unsigned long timer_read_counter(void) +{ + return 0; +} + +void reset_cpu(unsigned long a) +{ + while(1); +} +void emmc_clock_config(int mode) +{ + /* TODO: To be filled */ +} +int board_mmc_init(bd_t *bis) +{ + int ret; + + mmc_host.base = MSM_SDC1_BASE; + mmc_host.clk_mode = MMC_IDENTIFY_MODE; + emmc_clock_config(mmc_host.clk_mode); + + ret = qca_mmc_init(bis, &mmc_host); + + return ret; +} + diff --git a/board/qca/ipq806x/ipq806x.h b/board/qca/ipq806x/ipq806x.h new file mode 100644 index 0000000000..ca76a5ef4f --- /dev/null +++ b/board/qca/ipq806x/ipq806x.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _IPQ806X_H_ +#define _IPQ806X_H_ + +#include +#include + +#endif /* _IPQ806X_H_ */