

mhc
-
Posts
18 -
Joined
-
Last visited
Reputation Activity
-
mhc got a reaction from kerel in Enable SPI - Banana pi m2u
Hi martinayotte, many thanks for your comments.
I changed armbianEnv.txt file according your suggestion, but spi dev did not appear, however I modified compatible property in .dtsi (from "allwinner,sun8i-spi" to "allwinner,sun8i-h3-spi"; and after a reboot spidev0.0 does appear (even excluding overlay property in armbianEnv.txt).
allwinner,sun8i-spi made sense to me, it is difficult for me to know which driver to use in each case.
So, here is my working environment just in case someone has the same problem and wants to use it.
sun8i-r40.dtsi spi0_pins: spi0-pins { pins = "PC0", "PC1", "PC2"; function = "spi0"; }; spi0: spi@1c05000 { compatible = "allwinner,sun8i-h3-spi"; device_type = "spidev"; reg = <0x01c05000 0x1000>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>; clock-names = "ahb", "mod"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; resets = <&ccu RST_BUS_SPI0>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; }; And
sun8i-r40-bananapi-m2-ultra.dts &spi0 { status = "okay"; num-chipselects = <1>; cs-gpios = <&pio 2 23 GPIO_ACTIVE_LOW>; // CS = PC23 spidev@0 { reg = <0>; compatible = "spidev"; status = "okay"; spi-max-frequency = <1000000>; }; };
Thanks again!
mhc
-
mhc reacted to mflorezm in Banana Pi M2 Berry won't boot
Holy Mother of God, i found the problem.
I found on web blog that for eMMC as they are DDR they need a drive-strength of 40 instead of 30 like it was.
mmc2-pins {
pins = "PC5\0PC6\0PC7\0PC8\0PC9\0PC10\0PC11\0PC12\0PC13\0PC14\0PC15\0PC24";
function = "mmc2";
drive-strength = < 0x28 >; => equual to 40 in decimal
bias-pull-up;
phandle = < 0x12 >;
};
So, i guess that now somebody has to update the DTB with a patch.
Thanks.
Mauricio F.
-
mhc reacted to Werner in About Building Armbian
That cannot be answered by a simple yes or no. It depends.
Let's take the 5.4 example.
If you follow the current branch it leads us to megi's orangepi-5.4 branch. If you check the Makefile (https://github.com/megous/linux/blob/orange-pi-5.4/Makefile)
you will notice that the actual version of this branch is 5.4.18. But when you compile the kernel it is actually 5.4.47 or something like that.
This means these patches come from Armbian. If you check the patch directory for your board family (https://github.com/armbian/build/tree/master/patch/kernel/sunxi-current)
you can see that the upstream patches are added here. If you need a very specific kernel version remove or rename the patches you do not need.
That was a quite easy example to get what you want.
On other sources, vanilla for example, it is a bit tougher. You would need to specify a commit at which point you want to use the sources.
Sometimes a board is fixed to a specific commit or kernel version because it is known that newer version of the same kernel branch are known to be broken and (as most of the times) nobody has time or resources to deal with it.
-
mhc reacted to Asimov in Enable sound on Banana Pi M2 Ultra
I can enable bananpi M2 ultra sound (headphone and mic on pcb) You must add this on the dtsi file.
dma: dma-controller@01c02000 {
compatible = "allwinner,sun8i-h3-dma";
reg = <0x01c02000 0x1000>;
interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_DMA>;
resets = <&ccu RST_BUS_DMA>;
#dma-cells = <1>;
};
codec: codec@01c22c00 {
#sound-dai-cells = <0>;
compatible = "allwinner,sun8i-h3-codec";
reg = <0x01c22c00 0x300>;
interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_CODEC>;
clock-names = "apb", "codec";
resets = <&ccu RST_BUS_CODEC>;
dmas = <&dma 19>, <&dma 19>;
dma-names = "rx", "tx";
allwinner,codec-analog-controls = <&codec_analog>;
allwinner,audio-routing =
"Headphone", "HP",
"LINEIN", "Line In",
"MIC1", "MBIAS",
"MIC1", "Mic",
"MIC2", "HBIAS",
"MIC2", "Headset Mic";
status = "okay";
};
codec_analog: codec-analog@01c22f00 {
compatible = "allwinner,sun8i-a23-codec-analog";
reg = <0x01c22f00 0x4>;
};
Then modules that must be loaded are
sun8i_codec_analog 24576 1
sun4i_codec 32768 3
snd_soc_core 118784 2 sun4i_codec,sun8i_codec_analog
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 65536 2 snd_pcm_dmaengine,snd_soc_core
snd_timer 24576 1 snd_pcm
snd 45056 3 snd_timer,snd_soc_core,snd_pcm
soundcore 16384 1 snd
to test the player execute that to check the sound
$ aplay /usr/share/sounds/alsa/Front_Center.wav
then execute
$ alsamixer
to control the volumen and gain
To enable mic do that.
1) open alsamixer;
2) press "tab" to switch to capture;
3) press "bar" on the first capture channel;
"L_____R" red sign should appear;
4) select by arrow key MIC as the source of the first
input source;
2) record a test file:
arecord -f cd -D hw:0,0 -d 10 test.wav
play it back to test i.e.:
mplayer test.wav
Thats all ...
best regards Asimov
-
mhc got a reaction from Igor in Problem getting correct version of kernel headers
Hi Igor, thank you very much for your answer.
I understand that you contribute by using time you could spend on other things, and I am completely grateful for that.
I will help if I found something that " know how" from your link
Greetings