Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 81 additions & 1 deletion arch/arm/boot/dts/mt7623.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 MediaTek Inc.
* Copyright (c) 2017-2018 MediaTek Inc.
* Author: John Crispin <john@phrozen.org>
* Sean Wang <sean.wang@mediatek.com>
*
Expand Down Expand Up @@ -96,6 +96,9 @@
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x1>;
clocks = <&infracfg CLK_INFRA_CPUSEL>,
<&apmixedsys CLK_APMIXED_MAINPLL>;
clock-names = "cpu", "intermediate";
operating-points-v2 = <&cpu_opp_table>;
clock-frequency = <1300000000>;
};
Expand All @@ -104,6 +107,9 @@
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x2>;
clocks = <&infracfg CLK_INFRA_CPUSEL>,
<&apmixedsys CLK_APMIXED_MAINPLL>;
clock-names = "cpu", "intermediate";
operating-points-v2 = <&cpu_opp_table>;
clock-frequency = <1300000000>;
};
Expand All @@ -112,6 +118,9 @@
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x3>;
clocks = <&infracfg CLK_INFRA_CPUSEL>,
<&apmixedsys CLK_APMIXED_MAINPLL>;
clock-names = "cpu", "intermediate";
operating-points-v2 = <&cpu_opp_table>;
clock-frequency = <1300000000>;
};
Expand Down Expand Up @@ -262,6 +271,8 @@
compatible = "mediatek,mt7623-wdt",
"mediatek,mt6589-wdt";
reg = <0 0x10007000 0 0x100>;
interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_FALLING>;
#reset-cells = <1>;
};

timer: timer@10008000 {
Expand Down Expand Up @@ -485,6 +496,29 @@
nvmem-cell-names = "calibration-data";
};

btif_tx: btif_tx@11000780 {
compatible = "mediatek,btif_tx";
reg = <0 0x11000780 0 0x80>;
interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_LOW>;
status = "okay";
};

btif_rx: btif_rx@11000800 {
compatible = "mediatek,btif_rx";
reg = <0 0x11000800 0 0x80>;
interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>;
status = "okay";
};

btif: btif@1100c000 {
compatible = "mediatek,btif";
reg = <0 0x1100c000 0 0x1000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_BTIF>, <&pericfg CLK_PERI_AP_DMA>;
clock-names = "btifc", "apdmac";
status = "okay";
};

nandc: nfi@1100d000 {
compatible = "mediatek,mt7623-nfc",
"mediatek,mt2701-nfc";
Expand All @@ -510,6 +544,18 @@
status = "disabled";
};

nor_flash: spi@11014000 {
compatible = "mediatek,mt7623-nor",
"mediatek,mt8173-nor";
reg = <0 0x11014000 0 0x1000>;
clocks = <&pericfg CLK_PERI_FLASH>,
<&topckgen CLK_TOP_FLASH_SEL>;
clock-names = "spi", "sf";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

spi1: spi@11016000 {
compatible = "mediatek,mt7623-spi",
"mediatek,mt2701-spi";
Expand Down Expand Up @@ -661,6 +707,30 @@
status = "disabled";
};

consys: consys@18070000 {
compatible = "mediatek,mt7623-consys";
reg = <0 0x18070000 0 0x0200>, /*CONN_MCU_CONFIG_BASE */
<0 0x10001000 0 0x1600>; /*TOPCKGEN_BASE */
clocks = <&infracfg CLK_INFRA_CONNMCU>;
clock-names = "consysbus";
power-domains = <&scpsys MT2701_POWER_DOMAIN_CONN>;
interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_LOW>, /* BGF_EINT */
<GIC_SPI 163 IRQ_TYPE_LEVEL_LOW>; /* WDT_EINT */
resets = <&watchdog MT2701_TOPRGU_CONN_MCU_RST>;
reset-names = "connsys";
status="disabled";
};

wifi:wifi@180f0000 {
compatible = "mediatek,mt7623-wifi",
"mediatek,wifi";
reg = <0 0x180f0000 0 0x005c>;
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_AP_DMA>;
clock-names = "wifi-dma";
};


hifsys: syscon@1a000000 {
compatible = "mediatek,mt7623-hifsys",
"mediatek,mt2701-hifsys",
Expand Down Expand Up @@ -761,6 +831,16 @@
#reset-cells = <1>;
};

hsdma: dma-controller@1b007000 {
compatible = "mediatek,mt7623-hsdma";
reg = <0 0x1b007000 0 0x1000>;
interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>;
clocks = <&ethsys CLK_ETHSYS_HSDMA>;
clock-names = "hsdma";
power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
#dma-cells = <1>;
};

eth: ethernet@1b100000 {
compatible = "mediatek,mt7623-eth",
"mediatek,mt2701-eth",
Expand Down
66 changes: 64 additions & 2 deletions arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 Sean Wang <sean.wang@mediatek.com>
* Copyright 2017-2018 Sean Wang <sean.wang@mediatek.com>
*
* SPDX-License-Identifier: (GPL-2.0+ OR MIT)
*/
Expand Down Expand Up @@ -75,6 +75,18 @@
};
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
consys-reserve-memory {
compatible = "mediatek,consys-reserve-memory";
no-map;
size = <0 0x100000>;
alignment = <0 0x100000>;
};
};

leds {
compatible = "gpio-leds";
pinctrl-names = "default";
Expand Down Expand Up @@ -104,6 +116,10 @@
};
};

&btif {
status = "okay";
};

&cir {
pinctrl-names = "default";
pinctrl-0 = <&cir_pins_a>;
Expand Down Expand Up @@ -138,7 +154,6 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
pinctrl-names = "default";
reset-gpios = <&pio 33 0>;
core-supply = <&mt6323_vpa_reg>;
io-supply = <&mt6323_vemc3v3_reg>;
Expand Down Expand Up @@ -434,6 +449,32 @@
<MT7623_PIN_15_GPIO15_FUNC_UTXD2>;
};
};

uart3_pins_a: uart@3 {
pins_dat {
pinmux = <MT7623_PIN_242_URTS2_FUNC_URTS2>,
<MT7623_PIN_243_UCTS2_FUNC_UTXD3>;
};
};

consys_pins_default: consys_pins_default {
adie {
pinmux = <MT7623_PIN_60_WB_RSTB_FUNC_WB_RSTB>,
<MT7623_PIN_61_GPIO61_FUNC_TEST_FD>,
<MT7623_PIN_62_GPIO62_FUNC_TEST_FC>,
<MT7623_PIN_63_WB_SCLK_FUNC_WB_SCLK>,
<MT7623_PIN_64_WB_SDATA_FUNC_WB_SDATA>,
<MT7623_PIN_65_WB_SEN_FUNC_WB_SEN>,
<MT7623_PIN_66_WB_CRTL0_FUNC_WB_CRTL0>,
<MT7623_PIN_67_WB_CRTL1_FUNC_WB_CRTL1>,
<MT7623_PIN_68_WB_CRTL2_FUNC_WB_CRTL2>,
<MT7623_PIN_69_WB_CRTL3_FUNC_WB_CRTL3>,
<MT7623_PIN_70_WB_CRTL4_FUNC_WB_CRTL4>,
<MT7623_PIN_71_WB_CRTL5_FUNC_WB_CRTL5>;
bias-disable;
};
};

};

&pwm {
Expand Down Expand Up @@ -470,6 +511,21 @@
};
};

&consys {
mediatek,pwrap-regmap = <&pwrap>;
pinctrl-names = "default";
pinctrl-0 = <&consys_pins_default>;
vcn18-supply = <&mt6323_vcn18_reg>;
vcn28-supply = <&mt6323_vcn28_reg>;
vcn33_bt-supply = <&mt6323_vcn33_bt_reg>;
vcn33_wifi-supply = <&mt6323_vcn33_wifi_reg>;
status = "okay";
};

&watchdog {
status = "okay";
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
Expand All @@ -494,6 +550,12 @@
status = "okay";
};

&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins_a>;
status = "okay";
};

&usb1 {
vusb33-supply = <&reg_3p3v>;
vbus-supply = <&reg_5v>;
Expand Down
33 changes: 17 additions & 16 deletions arch/arm/configs/mt7623n_evb_fwu_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ CONFIG_WATCHDOG=y
CONFIG_MEDIATEK_WATCHDOG=y
CONFIG_MFD_MT6397=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_MT6323=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_RC_SUPPORT=y
Expand Down Expand Up @@ -259,33 +260,33 @@ CONFIG_CFG80211=y

#internal wlan (not working yet)
# CONFIG_MTK_CONN_LTE_IDC_SUPPORT is not set
#CONFIG_MTK_COMBO=y
#CONFIG_MTK_COMBO_CHIP_CONSYS_7623=y
CONFIG_MTK_COMBO=y
CONFIG_MTK_COMBO_CHIP_CONSYS_7623=y
#used in 4.4, but should be set in Kconfig by selecting mt7623 COMBO
#CONFIG_MTK_PLATFORM="mt7623"
CONFIG_MTK_PLATFORM="mt7623"

#CONFIG_MTK_COMBO_COMM=y
#CONFIG_MTK_COMBO_WIFI=y
#CONFIG_NL80211_TESTMODE=y
CONFIG_MTK_COMBO_COMM=y
CONFIG_MTK_COMBO_WIFI=y
CONFIG_NL80211_TESTMODE=y

#internal Bluetooth (also not working yet)
#CONFIG_BT=y
#CONFIG_MTK_COMBO_BT=y
#CONFIG_MTK_COMBO_BT_HCI=y
CONFIG_BT=y
CONFIG_MTK_COMBO_BT=y
CONFIG_MTK_COMBO_BT_HCI=y
#needed for BT?
#Bluetooth Classic (BR/EDR) features
#CONFIG_BT_BREDR=y
CONFIG_BT_BREDR=y
#Bluetooth High Speed (HS) features
#CONFIG_BT_HS=y
CONFIG_BT_HS=y
#Bluetooth Low Energy (LE) features
#CONFIG_BT_LE=y
CONFIG_BT_LE=y
#Export Bluetooth internals in debugfs
#CONFIG_BT_DEBUGFS=y
CONFIG_BT_DEBUGFS=y

#to run bluetoothd rfkill needed
#CONFIG_RFKILL_LEDS=y
#CONFIG_RFKILL_INPUT=y
#CONFIG_RFKILL_GPIO=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
CONFIG_RFKILL_GPIO=y


#if you use a mt76x2 or mt76x3 pcie-card
Expand Down
Empty file added build.log
Empty file.
20 changes: 15 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ crosscompile=0
if [[ -z $(cat /proc/cpuinfo | grep -i 'model name.*ArmV7') ]]; then
if [[ -z "$(which arm-linux-gnueabihf-gcc)" ]];then echo "please install gcc-arm-linux-gnueabihf";exit 1;fi

CCVER=$(arm-linux-gnueabihf-gcc --version |grep arm| sed -e 's/^.* \([0-9]\.[0-9-]\).*$/\1/')
if [[ $CCVER =~ ^7 ]]; then
echo "arm-linux-gnueabihf-gcc version 7 currently not supported";exit 1;
fi
export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
crosscompile=1
fi;
Expand Down Expand Up @@ -50,13 +54,18 @@ function install {
else
read -p "Press [enter] to copy data to SD-Card..."
if [[ -d /media/$USER/BPI-BOOT ]]; then
kernelfile=/media/$USER/BPI-BOOT/bananapi/bpi-r2/linux/uImage
imagename="uImage_${kernver}-${gitbranch}"
read -e -i $imagename -p "uImage-filename: " input
imagename="${input:-$imagename}"

echo "Name: $imagename"
kernelfile=/media/$USER/BPI-BOOT/bananapi/bpi-r2/linux/${imagename}
if [[ -e $kernelfile ]];then
echo "backup of kernel: $kernelfile.bak"
cp $kernelfile $kernelfile.bak
fi
echo "copy new kernel"
cp ./uImage /media/$USER/BPI-BOOT/bananapi/bpi-r2/linux/uImage
cp ./uImage $kernelfile
echo "copy modules (root needed because of ext-fs permission)"
export INSTALL_MOD_PATH=/media/$USER/BPI-ROOT/;
echo "INSTALL_MOD_PATH: $INSTALL_MOD_PATH"
Expand Down Expand Up @@ -94,7 +103,7 @@ function build {

exec 3> >(tee build.log)
export LOCALVERSION="-${gitbranch}"
make ${CFLAGS} 2>&3 #&& make modules_install 2>&3
make ${MAKEFLAGS} 2>&3 #&& make modules_install 2>&3
ret=$?
exec 3>&-

Expand Down Expand Up @@ -160,7 +169,8 @@ function prepare_SD {
if [ -n "$kernver" ]; then
action=$1
LANG=C
CFLAGS=-j$(grep ^processor /proc/cpuinfo | wc -l)
MAKEFLAGS=-j$(grep ^processor /proc/cpuinfo | wc -l)
# export KCFLAGS="-I/usr/lib/gcc-cross/arm-linux-gnueabihf/7/include"

case "$action" in
"reset")
Expand Down Expand Up @@ -261,7 +271,7 @@ if [ -n "$kernver" ]; then
exit 1;
fi;
$0 build
$0 cryptodev
# $0 cryptodev
if [ -e "./uImage" ]; then
echo "==========================================="
echo "1) pack"
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,5 @@ source "drivers/misc/echo/Kconfig"
source "drivers/misc/cxl/Kconfig"
source "drivers/misc/ocxl/Kconfig"
source "drivers/misc/cardreader/Kconfig"
source "drivers/misc/mediatek/Kconfig"
endmenu
2 changes: 2 additions & 0 deletions drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ OBJCOPYFLAGS_lkdtm_rodata_objcopy.o := \
targets += lkdtm_rodata.o lkdtm_rodata_objcopy.o
$(obj)/lkdtm_rodata_objcopy.o: $(obj)/lkdtm_rodata.o FORCE
$(call if_changed,objcopy)

obj-$(CONFIG_MTK_COMBO) += mediatek/
11 changes: 11 additions & 0 deletions drivers/misc/mediatek/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
menu "Mediatek Peripherals "

config MTK_PLATFORM
string "MTK platform name"
source "drivers/misc/mediatek/btif/Kconfig"

menu "Modem & Connectivity related configs"
source "drivers/misc/mediatek/connectivity/Kconfig"
endmenu

endmenu # CONN
Loading