azbest_hu
Posts: 8
Joined: Thu Sep 20, 2012 9:18 am

Re: Linux kernel is now 4.0

Sat Aug 01, 2015 7:11 pm

thank you :)

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Linux kernel is now 4.0

Sun Aug 02, 2015 12:45 am

Are there any plans to implent iscsi over TCP/IP?

I've been trying to get it work for the last few years with little success.

The (part1) instructions for iscsi initiator on elinux (can't post a link as it is down) now work, and it appears that it would be fairly trivial to flip the options so that it is built into the kernal.

As an aside, part 2 of the guide doesn't work.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5149
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Sun Aug 02, 2015 5:32 pm

asandford wrote: The (part1) instructions for iscsi initiator on elinux (can't post a link as it is down) now work, and it appears that it would be fairly trivial to flip the options so that it is built into the kernal.
Open a github issue (https://github.com/raspberrypi/linux) explaining the config options required and we'll look into adding it.

jofemodo
Posts: 8
Joined: Tue Aug 04, 2015 4:01 am

Re: Linux kernel is now 4.0

Tue Aug 04, 2015 4:41 am

Hi!

I can't change the UART clock. I've tried everything and i can't figure what is the problem.
I'm on kernel 4 from a few weeks ago. I've readed this thread (and many others!) and updated to the latest version.

Code: Select all

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo rpi-update
Also i've tried the "dtparam=uart0_clkrate=2441000" hack in config.txt, etc.
Nothing! The UART's clock is fixed to 3000000. I'm testing with a Oscilloscope.

My system is a Raspberry Pi 2, with PiTFT and HifiBerry.

My config.txt:

Code: Select all

# Adjust Serial Port Clock to allow MIDI baudrate 31250 
init_uart_clock=2441000
init_uart_baud=38400
#dtparam=uart0_clkrate=2441000

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
config_hdmi_boost=4
overscan_left=24
overscan_right=24
overscan_top=16
overscan_bottom=16
disable_overscan=1

# HifiBerry driver:
dtoverlay=hifiberry-dacplus

# PiTFT Config
[pi1]
device_tree=bcm2708-rpi-b-plus.dtb
[pi2]
device_tree=bcm2709-rpi-2-b.dtb
[all]
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28r,rotate=90,speed=32000000,fps=20
My cmdline.txt: (yes, only one line ;-)

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait bcm2708.uart_clock=3000000 fbcon=map:10 fbcon=font:VGA8x8
Please, can somebody help me with this? I'm completely blocked ;-(

Thank you!

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Linux kernel is now 4.0

Tue Aug 04, 2015 6:13 pm

dom wrote:
asandford wrote: The (part1) instructions for iscsi initiator on elinux (can't post a link as it is down) now work, and it appears that it would be fairly trivial to flip the options so that it is built into the kernal.
Open a github issue (https://github.com/raspberrypi/linux) explaining the config options required and we'll look into adding it.
OK, thanks

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5149
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Thu Aug 06, 2015 5:00 pm

The upstream 4.0 kernel tree is now end-of-line.
rpi-update kernel tree has switched to 4.1. If you spot any regressions, then report here:
viewtopic.php?f=29&t=117547

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Mon Aug 10, 2015 2:36 pm

@jofemodo Sorry for the delayed response - I've been on vacation, and Dom leaves the Device Tree questions to me.

The uart clock is slightly complicated because it is set in two places - one for Device Tree, one for non-DT.

All firmware reads the init_uart_clock config setting and uses it to generate a bcm2708.uart_clock (or bcm2709.uart_clock for a Pi2) setting for the kernel command line. You can see this value using:

Code: Select all

dmesg | grep uart
which in my case returns:

Code: Select all

[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa01041 bcm2709.serial=0x4d02916c smsc95xx.macaddr=B8:27:EB:02:91:6C bcm2708_fb.fbswap=1 bcm2709.uart_clock=2441000 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyAMA0,38400 console=tty1 ip=dhcp root=/dev/nfs nfsroot=192.168.0.172:/usr/share/piroot,udp rootfstype=nfs elevator=deadline rootwait loglevel=8 earlyprintk
[    0.190253] bcm2709.uart_clock = 2441000
(I've added init_uart_clock=2441000 to config.txt).

If you see an incorrect value here, it is probably because you have an explicit setting in your cmdline.txt (I see you have bcm2708.uart_clock=3000000, but that should be ignored because you are on a Pi 2).

< goes away and reads the code for the loader >

Nope - it won't be ignored, and that may be the problem. The firmware has an explicit check for bcm2708.uart_clock in cmdline.txt, and if found it won't supply its own version (either the default of 3MHz or the init_uart_clock value), even though in the Pi 2 case it should be looking for bcm2709.uart_clock.

1) Remove your explicit bcm2708.uart_clock=3000000 from your cmdline.txt - there is no reason to have it there. If this doesn't do the trick, try temporarily disabling DT ("device_tree=" in config.txt); if that fixes the problem, you need step 2.

2) Your firmware may just predate the change that propagates the init_uart_clock value to the DT - it was added in the July 16th release (d1f47370bc1f16416f2276cf41ac008bf1f802d6). Check the build date on your kernel, and rpi-update if it predates this.

3) I will fix the firmware to either check for the presence of bcm2709.uart_clock on a Pi 2 build (even though it won't help in the Device Tree case), or to remove this check altogether.

FYI, these lines:

Code: Select all

[pi1]
device_tree=bcm2708-rpi-b-plus.dtb
[pi2]
device_tree=bcm2709-rpi-2-b.dtb
[all]
can be omitted entirely as this is the default behaviour, but of course you can leave them in if you prefer to.

Also, these two lines are equivalent (on anything but a very early Model B):

Code: Select all

dtparam=i2c1=on
dtparam=i2c_arm=on
The use of explicit bus numbers (i2c1) is deprecated - use the symbolic equivalent instead - so it is better to delete the first line.

jofemodo
Posts: 8
Joined: Tue Aug 04, 2015 4:01 am

Re: Linux kernel is now 4.0

Tue Aug 11, 2015 12:23 am

[quote="PhilE"]

Hi Phie!

Thank you for your response!

>1) Remove your explicit bcm2708.uart_clock=3000000 from your cmdline.txt - there is no reason to have it there. If this doesn't >do the trick, try temporarily disabling DT ("device_tree=" in config.txt); if that fixes the problem, you need step 2.

In kernel 3.17, if i remove this parameter from "cmdline.txt" , it doesn't work (the frecuency stay fixed at 3000000).
In kernel 4.1, it doesn't work with or without this parameter (or bcm2709.uart_clock).

>2) Your firmware may just predate the change that propagates the init_uart_clock value to the DT - it was added in the July 16th >release (d1f47370bc1f16416f2276cf41ac008bf1f802d6). Check the build date on your kernel, and rpi-update if it predates this.

I've rpi-update, of course. But nothing..

Going back to 3.17 again ;-)

Thanks for your time!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Wed Aug 12, 2015 9:24 am

After a comment from Dom I found the other thread where you mention MIDI, so now I understand what you are trying to do and why, which for the benefit of other readers is to use the UART as the basis of a MIDI interface.

MIDI requires a 31.25Kbaud configuration, but this isn't a permissible value to the Linux UART infrastructure so we have to get creative. The workaround is to lie to Linux about the UART clock rate and the desired baud rate so that when it comes to calculate the divisor it ends up with a value that gives us the baud rate we really want. Let's use some real numbers:

1) legal_baudrate = 38400
2) pretend_clockrate = 3000000
3) divisor = pretend_clockrate/legal_baudrate = 78.125 (in reality this is an integer with an extra multiplier, but the principle is correct)

4) wanted_baudrate = 31250
5) actual_clockrate = divisor * wanted_baudrate = 2441406.25

The clock is controlled by the firmware, using the init_uart_clock value or the default of 3000000, so we need to set init_uart_clock to 2441000 (which is close enough for an integer divider). In 4.0 and later builds the UART configuration now comes from Device Tree, and can be altered using the uart0_clkrate parameter. The firmware uses this parameter to inform the kernel about any init_uart_clock setting, so what we need to do is override this value to continue to report 3000000, even though the real value is 2441000. Can't we just add:

Code: Select all

init_uart_clock=2441000
init_uart_baud=38400
dtparam=uart0_clkrate=3000000
to config.txt? Well we can, but it won't work. The reason is that settings calculated by the firmware are applied after the user settings - safe, but inflexible - so uart0_clkrate ends up at 2441000.

I have a small patch to the firmware that changes the order of DT construction so that user settings are applied later. With this change I can get the desired behaviour, i.e. the kernel thinks the UART clock is 3MHz but it is really 2.441MHz, so when we request 38400 baud we actually get ~31250 baud.

If we don't find any gotchas this change will make it into the next firmware release, but if you are keen to get it working sooner and get some confidence that the real fix will work for you, you can hack it now:

Code: Select all

sudo apt-get install device-tree-compiler
dtc -I dtb -O dts /boot/bcm2709-rpi-2-b.dtb | grep -v uart0_clkrate | sudo dtc -I dts -O dtb -o /boot/uart_hack.dtb
N.B. You may need to change bcm2709-rpi-2-b.dtb to bcm2708-rpi-b-plus.dtb or bcm2708-rpi-b.dtb, depending on your Pi. If you aren't sure, you can use:

Code: Select all

sudo vcdbg log msg |& grep Loading
to see what is being loaded. Then add:

Code: Select all

device_tree=uart_hack.dtb
to config.txt and reboot. That magic shell pipeline decompiles the DTB, cuts out the declaration of the uart0_clkrate parameter, and then recompiles it. Booting with this DTB will prevent the firmware from changing the clock rate value as seen by the UART, leaving it as the default 3MHz.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Thu Aug 13, 2015 9:52 am

Last night's firmware release, available via rpi-update, includes the change to the loader which removes the need for the hacked DTB. After updating, all you should need is:

Code: Select all

init_uart_clock=2441000
init_uart_baud=38400
dtparam=uart0_clkrate=3000000
Take care to remove the explicit "device_tree=uart_hack.dtb" (if you used it), to avoid confusing behaviour with future updates.

jofemodo
Posts: 8
Joined: Tue Aug 04, 2015 4:01 am

Re: Linux kernel is now 4.0

Thu Aug 13, 2015 6:14 pm

[quote="PhilE"]

Hi PhIE!! It works like a charm!!
Thank you very much!!!

Best Regards!

bla
Posts: 11
Joined: Sun Mar 29, 2015 6:59 am

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 2:04 am

Unlike with other updates, my v1 B model (256M ram) boots "beyond the rainbow", but it does not find device mapper and thus cannot mount the encrypted root partition [1],[2]. A v2 B of a friend which i setup myself seems to work fine with the same setup. Any idea what fux up dm in my case (reports it can't find /dev/mapper/control)? Cheers!

I'm still stuck to this version: Linux raspberrypi 3.18.11+ #776 PREEMPT Mon Apr 6 13:13:58 BST 2015 armv6l GNU/Linux (though not even every commit of 3.18.11 boots with my pi AFAIR).

[1] http://paxswill.com/blog/2013/11/04/enc ... pberry-pi/
[2] https://www.ofthedeed.org/posts/Encrypted_Raspberry_Pi/

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 12:30 pm

Have you got any output you can share, e.g. from the serial console or a screen shot?

bla
Posts: 11
Joined: Sun Mar 29, 2015 6:59 am

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 12:49 pm

Sure, I appreciate your interest in my problem and am sorry for not including this in my initial post. Thanks for your time!

Code: Select all

modprobe: chdir(4.1.5+): No such file or directory
Unlocking the disk /dev/mmcblk0p2 (xxx)
Enter passphrase: /dev/mapper/control: open failed: No such device
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Cannot initialize device-mapper. Is dm_mod kernel module loaded?
Edit: w/ the working kernel mention above, the output is as follows (connection to dropbear is supposed to be closed upon successful decryption, see pages cited above).

Code: Select all

Unlocking the disk /dev/mmcblk0p2 (xxx)
Enter passphrase: <inserting pass>
cryptsetup: xxx set up successfully
Connection to xxx closed.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 1:10 pm

When you upgraded to the new kernel, did you also rebuild your initrd? The error message sounds like it might be a version mismatch problem.

bla
Posts: 11
Joined: Sun Mar 29, 2015 6:59 am

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 1:14 pm

I have just retried it once again, definitely building the initrd just before boot. The problem is still the same.

Edit: also have tried remaking initrd for 3.8.11 now: works fine.

Edit2: Any hint on how to debug this problem is appreciated! I am willing to take almost every effort including compiling kernels on my pi. Just let me know anything I can do. Cheers!

bla
Posts: 11
Joined: Sun Mar 29, 2015 6:59 am

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 4:05 pm

Is there any place beyond this I should/can report this problem? Cheers!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 4:27 pm

If you can produce a simple, precise sequence of steps to get from a known starting point (an apt-get update+upgrade followed by an rpi-update, for example) to this failure, preferably one that doesn't require encrypting the filing system, then there is a chance somebody here might be able to help you.

You could also go back to the authors of the guides you've followed and see if they have any ideas.

bla
Posts: 11
Joined: Sun Mar 29, 2015 6:59 am

Re: Linux kernel is now 4.0

Sun Aug 16, 2015 5:00 pm

Thanks for your reply. However, the problem is indeed the encryption and the latest version of the kernel so I am afraid neither the authors of the guides mentioned above nor an example not using encryption might help. I have to get in contact with "Hexxeh" i guess. Thanks anyway for the time your have spend on understanding my prob!

E: https://github.com/Hexxeh/rpi-update/issues/188

podulator
Posts: 2
Joined: Sun Aug 23, 2015 10:39 am

Re: Linux kernel is now 4.0

Sun Aug 23, 2015 10:54 am

Hi PhilE, Can i beg a little of your time on the same problem?
I'm trying to get MIDI going via the UART as well.
I've gone thru all of the steps you mentioned here, as well as a couple of other bits and pieces for I2C etc gleaned from other places.
Here's the lie of the land currently...

Code: Select all

[email protected]:/home/mat# rpi-update       
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Your firmware is already up to date

Code: Select all

[email protected]:/home/mat# uname -a
Linux testpi 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l GNU/Linux

Code: Select all

[email protected]:/home/mat# /opt/vc/bin/vcgencmd version
Aug 20 2015 17:44:52 
Copyright (c) 2012 Broadcom
version 3f87086448257aa66881de858a0b4b0e6daa8719 (clean) (release)

Code: Select all

[email protected]:/home/mat# dmesg | grep uart            
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial=0xa1b6e518 smsc95xx.macaddr=B8:27:EB:B6:E5:18 bcm2708_fb.fbswap=1 bcm2709.uart_clock=2441000 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[    0.189303] bcm2709.uart_clock = 2441000
[    0.195028] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev2

Code: Select all

[email protected]:/home/mat# cat /boot/config.txt
...
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
...
# Change UART clock to 2441406 for MIDI 31250 baud rate 
init_uart_clock=2441000
init_uart_baud=38400
dtparam=uart0_clkrate=3000000

Code: Select all

[email protected]:/home/mat# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Any thoughts?
does the dmesg | grep uart look as expected to you?
Thanks for any time you can spare on this, i'm stumped!
Mat

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1866
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 4.0

Sun Aug 23, 2015 4:51 pm

The output looks correct (if a little confusing) from memory.

Have you tried forcing the (fake) baud rate?:

Code: Select all

stty -f /dev/ttyAMA0 38400
UPDATE: corrected device name

podulator
Posts: 2
Joined: Sun Aug 23, 2015 10:39 am

Re: Linux kernel is now 4.0

Sun Aug 23, 2015 5:27 pm

Hey, thanks for the reply.
I didn't realise that it still had to be set explicitly like that, thanks for the heads up.
for anyone else following along it's

Code: Select all

stty -F /dev/ttyAMA0 38400
and it seems to be happy with the setting :)

i'm going to go and revert back to the original circuit and try again.
thanks again!

AFUDirk
Posts: 5
Joined: Wed Apr 01, 2015 9:38 am
Location: Germany
Contact: Website

Re: Linux kernel is now 4.0

Tue Aug 25, 2015 7:27 am

I use my Raspberry Pi 2 B with RPi_Cam_Web_Interface where I ansteuere the camera with servos (pan, tilt).
With the update to kernel 4.1, control my servos, which are driven via the servo Blaster no longer works.
No longer supported servo Blaster, or has been changed a bit to the I2C drivers.

User avatar
joan
Posts: 13557
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.0

Tue Aug 25, 2015 7:39 am

AFUDirk wrote:I use my Raspberry Pi 2 B with RPi_Cam_Web_Interface where I ansteuere the camera with servos (pan, tilt).
With the update to kernel 4.1, control my servos, which are driven via the servo Blaster no longer works.
No longer supported servo Blaster, or has been changed a bit to the I2C drivers.
servoblaster will need an update to work with 4.1. You could use pigpio instead.

AFUDirk
Posts: 5
Joined: Wed Apr 01, 2015 9:38 am
Location: Germany
Contact: Website

Re: Linux kernel is now 4.0

Fri Sep 04, 2015 7:21 am

Did Richard Hirst wrote to, he is very busy, but I would try to find the time to make an update for Servblaster.
pigpio is indeed determined not to use 1 to1?
I do not have sufficient knowledge, RPi_Web_Cam_Interface to rebuild so, make it work with pigpio.

Return to “Advanced users”

Who is online

Users browsing this forum: Andyroo and 12 guests