i’ve tried now to build the 4.14-rc5 using that commands:
sudo apt-get install git make gcc-arm-linux-gnueabihf u-boot-tools
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git bpi-r2
cd bpi-r2
cp path/to/mt7623n_evb_bpi_defconfig arch/arm/configs/
make ARCH=arm mt7623n_evb_bpi_defconfig
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
export INSTALL_MOD_PATH=$(pwd)/mod/
mkdir $INSTALL_MOD_PATH
make
make uImage LOADADDR=0x80008000
make modules_install
copied kernel and modules on SD-Card, boot hangs at loading kernel:
reading bananapi/bpi-r2/linux/uEnv.txt
771 bytes read in 9 ms (83 KiB/s)
Loaded environment from uEnv.txt
Banana Pi bpi-r2 chip: mt7623n Service: linux
reading bananapi/bpi-r2/linux/uImage
8188984 bytes read in 1071 ms (7.3 MiB/s)
reading bananapi/berryboot.img
** Unable to read file bananapi/berryboot.img **
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
Image Name: Linux-4.14.0-rc5-BPI-R2-Kernel
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 8188920 Bytes = 7.8 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Starting kernel ...
then it stops…any idea? I assume there is a Problem with the DTB, which should be compiled in the kernel, but how can i check this? I’ve tried using that from BPI-R2-github but filename differ resulting in build-error, renamed it, but seems not compatible:
DTC arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dtb
Error: arch/arm/boot/dts/mt7623.dtsi:376.25-26 syntax error
FATAL ERROR: Unable to parse input tree
line 376 of that file (from BPI-R2 github) is:
clocks = <&apmixedsys CLK_APMIXED_HDMI_REF>;
seems CLK_APMIXED_HDMI_REF is undefined…in BPI-R2-bsp it is defined here:
linux-mt/arch/arm/boot/dts/include/dt-bindings/clock/mt2701-clk.h:196:#define CLK_APMIXED_HDMI_REF 14
maybe its not the only one…but how can i check if dts is correctly appended?
got kernel booting using the original dts(i) by creating the uImage this way:
cat arch/arm/boot/zImage arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dtb >zImage_dtb
mkimage -A arm -O linux -C none -T kernel -a 0x80008000 -e 0x80008000 -d zImage_dtb uImage
now kernel boots, but hangs at waiting for mmcblk1
boot.log (32,8 KB)
it seems that devicetree is not correct for the mmc-devices (and some other):
[ 4.568999] mtk-msdc 11230000.mmc: could not find pctldev for node /pinctrl@10005000/mmc0default, deferring probe
[ 4.579244] mtk-msdc 11240000.mmc: could not find pctldev for node /pinctrl@10005000/mmc1default, deferring probe
comparing the relevant parts:
$ diff -y bpi.dtsi kernel.dtsi
pio: pinctrl@10005000 { pio: pinctrl@10005000 {
compatible = "mediatek,mt7623-pinctrl"; | compatible = "mediatek,mt7623-pinctrl",
> "mediatek,mt2701-pinctrl";
reg = <0 0x1000b000 0 0x1000>; reg = <0 0x1000b000 0 0x1000>;
mediatek,pctl-regmap = <&syscfg_pctl_a>; mediatek,pctl-regmap = <&syscfg_pctl_a>;
pins-are-numbered; pins-are-numbered;
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
interrupt-parent = <&gic>; interrupt-parent = <&gic>;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
<GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH
<
hdmi_pin: htplg { <
pins1 { <
pinmux = <MT7623_PIN_123_HTPL <
input-enable; <
bias-pull-down; <
}; <
}; <
}; };
syscfg_pctl_a: syscfg@10005000 { syscfg_pctl_a: syscfg@10005000 {
compatible = "mediatek,mt7623-pctl-a-syscfg", compatible = "mediatek,mt7623-pctl-a-syscfg",
reg = <0 0x10005000 0 0x1000>; reg = <0 0x10005000 0 0x1000>;
}; };
mmc0: mmc@11230000 { mmc0: mmc@11230000 {
compatible = "mediatek,mt2701-mmc"; | compatible = "mediatek,mt7623-mmc",
> "mediatek,mt8135-mmc";
reg = <0 0x11230000 0 0x1000>; reg = <0 0x11230000 0 0x1000>;
interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>; interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_MSDC30_0>, clocks = <&pericfg CLK_PERI_MSDC30_0>,
<&topckgen CLK_PERI_MSDC50_3>; | <&topckgen CLK_TOP_MSDC30_0_SEL>;
clock-names = "source", "hclk"; clock-names = "source", "hclk";
status = "disabled"; status = "disabled";
}; };
mmc1: mmc@11240000 { mmc1: mmc@11240000 {
compatible = "mediatek,mt2701-mmc"; | compatible = "mediatek,mt7623-mmc",
> "mediatek,mt8135-mmc";
reg = <0 0x11240000 0 0x1000>; reg = <0 0x11240000 0 0x1000>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_LOW>; interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_MSDC30_1>, clocks = <&pericfg CLK_PERI_MSDC30_1>,
<&clk_null>; | <&topckgen CLK_TOP_MSDC30_1_SEL>;
clock-names = "source", "hclk"; clock-names = "source", "hclk";
status = "disabled"; status = "disabled";
}; };
tried to change the compatible-line, but seems not working, i don’t know where mt2701-mmc is defined. definition in bananapi.dts is the block of mmc0/1 swapped, but definitions seems equal
any idea?