diff options
Diffstat (limited to 'docs/misc')
-rw-r--r-- | docs/misc/bbb_ehci.md | 44 | ||||
-rw-r--r-- | docs/misc/index.md | 87 | ||||
-rw-r--r-- | docs/misc/patch.md | 81 |
3 files changed, 113 insertions, 99 deletions
diff --git a/docs/misc/bbb_ehci.md b/docs/misc/bbb_ehci.md index fdfab7d0..0246a382 100644 --- a/docs/misc/bbb_ehci.md +++ b/docs/misc/bbb_ehci.md @@ -1,7 +1,11 @@ -% EHCI debugging on the BeagleBone Black + +EHCI debugging on the BeagleBone Black +====================================== [Back to previous index](./) + + EHCI debugging ============== @@ -99,7 +103,7 @@ section): ls /lib/modules/3.8.13-bone70/kernel/drivers/usb/gadget/g_dbgp.ko -Unload all other g\_* modules: +Unload all other g\_\* modules: # lsmod # rmmod g_multi @@ -122,8 +126,7 @@ next step. ### Patch BBB's g\_dbgp module (optional, but highly recommended) {#PatchBBBsgdbgpmoduleoptionalbuthighlyrecommended} For the reasons why you need this, see: [EHCI Gadget -Debug](http://www.coreboot.org/EHCI_Gadget_Debug). - +Debug](http://www.coreboot.org/EHCI_Gadget_Debug).\ Make sure that you have cross compiling environment for arm-linux-gnueabihf setup on your *host*. @@ -134,10 +137,10 @@ arm-linux-gnueabihf setup on your *host*. <!-- --> - $ cd \$work_dir + $ cd $work_dir $ git clone https://github.com/beagleboard/kernel.git $ cd kernel - $ git checkout \$mav (see above) + $ git checkout $mav (see above) $ ./patch.sh $ wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin $ cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig @@ -150,7 +153,7 @@ arm-linux-gnueabihf setup on your *host*. the two different version of the kernel (3.8 and 3.10). I will use 3.8. (If using kernel 3.12 patch\_1 is not needed) - cd kernel (note that this is one more level: you should be in - $work\_dir/kernel/kernel) + \$work\_dir/kernel/kernel) - Apply the patches: <!-- --> @@ -185,18 +188,17 @@ arm-linux-gnueabihf setup on your *host*. - on BBB, backup /lib/modules/3.8.13-bone70/kernel/drivers/usb/gadget (i.e. mv /lib/modules/3.8.13-bone70/kernel/drivers/usb/gadget - $HOME) + \$HOME) - copy the freshly compiled usb/gadget dir to /lib/modules/3.8.13-bone70/kernel/drivers/usb - restart BBB -- Remove all g\_* modules (rmmod g\_<>) +- Remove all g\_\* modules (rmmod g\_<>) - modprobpe g\_dbgp ### Configure libreboot with EHCI debug {#ConfigurelibrebootwithEHCIdebug} Libreboot(coreboot) should be configured with debug turned on and to -push debug messages to the EHCI debug port. - +push debug messages to the EHCI debug port.\ If you've downloaded the binary distribution, you can check if it is properly configured in the following way: @@ -207,7 +209,7 @@ properly configured in the following way: <!-- --> - ./cbfstool/i686/cbfstool \$img_path extract -n config -f ./my_config + ./cbfstool/i686/cbfstool $img_path extract -n config -f ./my_config - Make sure that the following params in the config are set as following: @@ -232,7 +234,7 @@ documented [here](https://johnlewis.ie/coreboot-ehci-debug-gadget-demonstration/) (also tested/verified). -Then: +Then:\ CONFIG_CONSOLE_USB=y (Console -> USB dongle console output) @@ -253,8 +255,7 @@ refer to the doc(**FIXME: link** about compiling libreboot. #### Selecting HCD Index and USB Debug port {#SelectingHCDIndexandUSBDebugport} This applies (and works) only if the USB controller that supports debug -(found in the first section) is from Intel. - +(found in the first section) is from Intel.\ If the PCI ID of the port you found in the first section is 0000:00:1a.0 or 0000:00:1d.0 , you are ok. Otherwise you have to try without guarantee that will work. @@ -265,12 +266,10 @@ then for CONFIG\_USBDEBUG\_HCD\_INDEX choose 2, otherwise choose 0 . For CONFIG\_USBDEBUG\_DEFAULT\_PORT choose the port from the first section that correspond to the PCI ID -Notes: - +Notes:\ The above is based on the implementation of coreboot/src/southbridge/intel/common/usb\_debug.c : -pci\_ehci\_dbg\_dev() . - +pci\_ehci\_dbg\_dev() .\ This is enough as it applies for the supported GM45/G45 Thinkpads. coreboot support some other contollers too, but they are irellevent for libreboot (for now). @@ -283,7 +282,7 @@ libreboot (for now). - Plug the USB cable in the target's debug port (the one you found in step 1) and BBB's mini-B USB -- Make sure no other then g\_dbgp of the g\_* modules is loaded on +- Make sure no other then g\_dbgp of the g\_\* modules is loaded on your BBB - On the BBB: @@ -296,7 +295,7 @@ libreboot (for now). - You should see debug logs comming on your BBB console Note that this is not permanent on BBB, if you reboot it, you have to -rmmod g\_* and modprobe g\_dbgp +rmmod g\_\* and modprobe g\_dbgp ### Eneble EHCI Debug on the target's kernel (optional, recommended) {#EnebleEHCIDebugonthetargetskerneloptionalrecommended} @@ -355,8 +354,9 @@ Interface](http://cs.usfca.edu/~cruse/cs698s10/) 3. Patch and compule g\_dbgp on BBB instead cross-compile 4. Find a simple way to send debug messages from targets userland -Copyright © 2015 Alex David <opdecirkel@gmail.com> + +Copyright © 2015 Alex David <opdecirkel@gmail.com>\ Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license or any later version published by Creative diff --git a/docs/misc/index.md b/docs/misc/index.md index e97650e1..44503755 100644 --- a/docs/misc/index.md +++ b/docs/misc/index.md @@ -1,4 +1,7 @@ -% Miscellaneous + +Miscellaneous +============= + - [High Pitched Whining Noise on Idle (how to remove in Debian or Devuan)](#debian_powertop) @@ -14,9 +17,12 @@ Black](bbb_ehci.html) - [e1000e driver trouble shooting (Intel NICs)](#e1000-hang) + + High Pitched Whining Noise on Idle (how to remove in Debian or Devuan) {#debian_powertop} ====================================================================== + Start powertop automatically at boot time {#debian_powertop_autostart} ----------------------------------------- @@ -32,6 +38,11 @@ If powertop doesn't work, another way (reduces battery life slightly) is to add *processor.max\_cstate=2* to the *linux* line in grub.cfg, using [this guide](../gnulinux/grub_cbfs.html). + +[Back to top of page](#pagetop) + + + High Pitched Whining Noise on Idle (how to remove in Parabola) {#high_pitch_parabola} ============================================================== @@ -48,13 +59,11 @@ On the X60 with coreboot or libreboot, there is a high pitched sound when idle. So far we have use processor.max\_cstate=2 or idle=halt in GRUB. These consume power. Stop using them! -Be root +Be root\ +**\$ su -** - $ su - - -Installed powertop: - - # pacman -S powertop +Installed powertop:\ +**\# pacman -S powertop** and added the following to /etc/systemd/system/powertop.service : @@ -71,10 +80,9 @@ and added the following to /etc/systemd/system/powertop.service : [Install] WantedBy=multi-user.target -Finally, as root do that: - - # systemctl enable powertop - # systemctl start powertop +Finally, as root do that:\ +**\# systemctl enable powertop**\ +**\# systemctl start powertop** The next time you boot the system, the buzz will be gone. @@ -84,6 +92,10 @@ If powertop doesn't work, another way (reduces battery life slightly) is to add *processor.max\_cstate=2* to the *linux* line in grub.cfg, using [this guide](../gnulinux/grub_cbfs.html). +[Back to top of page](#pagetop) + + + X60/T60: Serial port - how to use (for dock owners) {#serial} =================================================== @@ -97,9 +109,8 @@ included inside the ROM. Connect your null modem cable to the serial port on the dock and connect the other end to a 2nd system using your USB Serial adapter. -On the 2nd system, you can try this (using GNU Screen): - - $ sudo screen /dev/ttyUSB0 115200 +On the 2nd system, you can try this (using GNU Screen):\ +**\$ sudo screen /dev/ttyUSB0 115200** How to quit GNU Screen: Ctrl+A then release and press K, and then press Y. @@ -113,8 +124,7 @@ can also configure your distro so that a terminal (TTY) is accessible from the serial console. The following guide is for Ubuntu, but it should work in Debian and -Devuan, to enable a serial console using GeTTY: - +Devuan, to enable a serial console using GeTTY:\ <https://help.ubuntu.com/community/SerialConsoleHowto> (we DO NOT recommend Ubuntu, because it contains non-free software in the default repos. Use Debian or Devuan) @@ -123,6 +133,10 @@ Note: part of the tutorial above requires changing your grub.cfg. Just change the **linux** line to add instructions for enabling getty. See [../gnulinux/grub\_cbfs.html](../gnulinux/grub_cbfs.html). +[Back to top of page](#pagetop) + + + Finetune backlight control on intel gpu's ========================================= @@ -197,7 +211,7 @@ duty cycle. see <https://review.coreboot.org/#/c/10624/> on bit 16. The cause of this issue is that i945, in contrast with to GM45, is set to work in BLM Legacy Mode. This makes backlight more complicated since the duty cycle is derived from 3 instead of 2 registers using the following -formula: if(BPC\[7:0\] <> xFF) then BPCR\[15:0\] * BPC\[7:0\] +formula: if(BPC\[7:0\] <> xFF) then BPCR\[15:0\] \* BPC\[7:0\] Else BPCR\[15:0\] BPC is LBB - PCI Backlight Control Register, described on <http://www.mouser.com/pdfdocs/945gmedatasheet.pdf> on page 315. BPCR is BLC\_PWM\_CTL described in @@ -205,6 +219,8 @@ is BLC\_PWM\_CTL described in on page 94. More research needs to be done on this target so proceed with care. + + Power Management Beeps on Thinkpads =================================== @@ -213,32 +229,30 @@ battery goes to a critically low charge level, a beep occurs. Nvramtool is included in libreboot, and can be used to enable or disable this behaviour. -Disable or enable beeps when removing/adding the charger: - - $ sudo ./nvramtool -w power\_management\_beeps=Enable +Disable or enable beeps when removing/adding the charger:\ +\$ **sudo ./nvramtool -w power\_management\_beeps=Enable**\ \$ **sudo ./nvramtool -w power\_management\_beeps=Disable** -Disable or enable beeps when battery is low: - - $ sudo ./nvramtool -w low\_battery\_beep=Enable +Disable or enable beeps when battery is low:\ +\$ **sudo ./nvramtool -w low\_battery\_beep=Enable**\ \$ **sudo ./nvramtool -w low\_battery\_beep=Disable** A reboot is required, for these changes to take effect. + + Get EDID: Find out the name (model) of your LCD panel {#get_edid_panelname} ===================================================== -Get the panel name with sudo get-edid | strings +Get the panel name with **sudo get-edid | strings**\ Or look in **/sys/class/drm/card0-LVDS-1/edid** Alternatively you can use i2cdump. In Debian and Devuan, this is in the -package i2c-tools. - - $ sudo modprobe i2c-dev +package i2c-tools.\ +\$ **sudo modprobe i2c-dev**\ \$ **sudo i2cdump -y 5 0x50** (you might have to change the value for --y) - - $ sudo rmmod i2c-dev +-y)\ +\$ **sudo rmmod i2c-dev**\ You'll see the panel name in the output (from the EDID dump). If neither of these options work (or they are unavailable), physically @@ -247,6 +261,8 @@ printed on the back. [Back to top of page.](#pagetop) + + e1000e driver trouble shooting (Intel NICs) {#e1000-hang} =========================================== @@ -255,16 +271,14 @@ needed for cause): e1000e 0000:00:19.0 enp0s25: Detected Hardware Unit Hang -Possible workaround, tested by Nazara: Disable C-STATES. - +Possible workaround, tested by Nazara: Disable C-STATES.\ **NOTE: this also disables power management, because disabling C-States means that your CPU will now be running at full capacity (and therefore using more power) non-stop, which will drain battery life if this is a laptop. If power usage is a concern, then you should not use this. (we're also not sure whether this workaround is appropriate)** -To disable c-states, do this in GNU+Linux: - +To disable c-states, do this in GNU+Linux:\ **for i in /sys/devices/system/cpu/cpu/cpuidle/state/disable; do echo 1 > \$i; done** @@ -274,6 +288,8 @@ across subnets on the same interface (NIC). More information, including logs, can be found on [this page](https://notabug.org/vimuser/libreboot/issues/23). + + USB keyboard wakeup on GM45 laptops {#usb_keyboard_gm45} =================================== @@ -281,8 +297,9 @@ Look at resources/scripts/helpers/misc/libreboot\_usb\_bugfix Put this script in /etc/init.d/ on debian-based systems. -Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org> + +Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\ Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license or any later version published by Creative diff --git a/docs/misc/patch.md b/docs/misc/patch.md index 318c7428..9f6125c5 100644 --- a/docs/misc/patch.md +++ b/docs/misc/patch.md @@ -1,20 +1,22 @@ -% Diff and patch + +Diff and patch +============== This is just a quick guide for reference, use 'man' to know more. [Back to index](./) + + Apply a patch ============= -To apply a patch to a single file, do that in it's directory: - - $ patch < foo.patch +To apply a patch to a single file, do that in it's directory:\ +**\$ patch < foo.patch** Assuming that the patch is distributed in unified format identifying the -file the patch should be applied to, the above will work. Otherwise: - - $ patch foo.txt < bar.patch +file the patch should be applied to, the above will work. Otherwise:\ +**\$ patch foo.txt < bar.patch** You can apply a patch to an entire directory, but note the "p level". What this means is that inside patch files will be the files that you @@ -22,46 +24,43 @@ intend to patch, identified by path names that might be different when the files ane located on your own computer instead of on the computer where the patch was created. 'p' level instructs the 'patch' utility to ignore parts of the path name to identify the files correctly. -Usually a p level of 1 will work, so you would use: - - $ patch -p1 < baz.patch +Usually a p level of 1 will work, so you would use:\ +**\$ patch -p1 < baz.patch** Change to the top level directory before running this. If a patch level of 1 cannot identify the files to patch, then inspect the patch file for -file names. For example: - +file names. For example:\ **/home/user/do/not/panic/yet.c** -and you are working in a directory that contains panic/yet.c, use: - - $ patch -p5 < baz.patch +and you are working in a directory that contains panic/yet.c, use:\ +**\$ patch -p5 < baz.patch** You usually count one up for each path separator (forward slash) removed from the beginning of the path, until you are left with a path that exists in the current working directory. The count is the p level. -Removing a patch using the -R flag - - $ patch -p5 -R < baz.patch +Removing a patch using the -R flag\ +**\$ patch -p5 -R < baz.patch** [Back to top of page.](#pagetop) + + Create a patch with diff ======================== -Diff can create a patch for a single file: +Diff can create a patch for a single file:\ +**\$ diff -u original.c new.c > original.patch** - $ diff -u original.c new.c > original.patch +For diff'ing a source tree:\ +**\$ cp -R original new** -For diff'ing a source tree: +Do whatever you want in new/ and then diff it:\ +**\$ diff -rupN original/ new/ > original.patch** - $ cp -R original new - -Do whatever you want in new/ and then diff it: +[Back to top of page.](#pagetop) - $ diff -rupN original/ new/ > original.patch -[Back to top of page.](#pagetop) git diff ======== @@ -70,34 +69,31 @@ git is something special. Note: this won't show new files created. -Just make whatever changes you want to a git clone and then: - - $ git diff > patch.git - -Note the git revision that you did this with: - - $ git log +Just make whatever changes you want to a git clone and then:\ +**\$ git diff > patch.git** -Alternatively (better yet), commit your changes and then use: +Note the git revision that you did this with:\ +**\$ git log** - $ git format-patch -N +Alternatively (better yet), commit your changes and then use:\ +\$ **git format-patch -N**\ Replace N with the number of commits that you want to show. [Back to top of page.](#pagetop) + + git apply ========= it really is. Now to apply that patch in the future, just git clone it again and do -with the git revision you found from above: - - $ git reset \--hard REVISIONNUMBER +with the git revision you found from above:\ +**\$ git reset \--hard REVISIONNUMBER** -Now put patch.git in the git clone directory and do: - - $ git apply patch.git +Now put patch.git in the git clone directory and do:\ +**\$ git apply patch.git** If you use a patch from git format-patch, then use **git am patch.git** instead of **git apply patch.git**. git-am will re-create the commits @@ -105,8 +101,9 @@ aswell, instead of just applying the patch. [Back to top of page.](#pagetop) -Copyright © 2014, 2015 Leah Rowe <info@minifree.org> + +Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\ Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license or any later version published by Creative |