Top.Mail.Ru
? ?

путин — кто?
proud
andy_shev
https://youtube.com/watch?v=3g1RoSuM0i0


Dell Venue 7 3740: How to get serial interface
carstyle
andy_shev
After experimenting with Intel Edison board I decided to have a look at Dell Venue 7 3740 which is based on the same chip (but has higher frequency and bigger eMMC, including LTE modem, display, and audio). It can be found on the second hand market for something like 60€ + delivery (as of day of writing this blog post).
Dell Venue 7 3740
Before doing anything useful it would be nice to have an access to the only free serial port (the same as for Intel Edison it's called /dev/ttyMFD2 in the stock kernel). For this, let's open a back cover and look at the motherboard:
Dell Venue 7 3740 motherboard
Our interest here is the 40-pin connector which has last 4 pins related to the UART, but it's good that we may find necessary signals in better, from soldering perspective, locations as depicted below:
UART pins
The signals are +1.8v TTL, be aware to find an appropriate adapter. Luckily I have had one which is +1.8v by default and connected directly to it, so +1.8v signal is unconnected in my case, while being soldered just in case:
UART connection
The stock image doesn't issue anything to UART. However, if you rooted the device as pretty well described in the Dell official documentation, you would be able to run something like
adb shell
dmesg > /dev/ttyMFD2


(Note that default UART settings are 9600,8,n,1)

Next step is to build U-Boot for it, stay tuned!

This entry was originally posted at https://andy-shev.dreamwidth.org/152335.html. Please comment there using OpenID.

HTTP-only accessible PDU (Power Delivery Units)
proud
andy_shev
In our lab we are using a lot of different DUTs and most of them are connected via PDUs for the remote power cycle. The biggest part of PDUs are APC 7820B or similar (from APC). APC is controllable via SNMP and everything is so far, so good.

Couple of years ago I have got Keil Systems EnviroBot PDU (not produced anymore) from e-waste, which is 12 ports and quite an interesting device in a sense that it's accessible via HTTP only.

After a few hours of experimenting (yeah, I'm not a ninja in HTML/XML + shell) I have nailed it down to make it accessible via our scripts that in their turn are for users logged via SSH.

So, to show the state of the certain port:
curl -s -L --noproxy '*' -o "<FILE>" "http://<ADDRESS>/power.cgi?mdu=0"
xmllint --xpath "//tr[td/input[@name=\"switch<PORT>\"]]/td[3]/text()" --html "<FILE>" 2>/dev/null

Turning OFF...
curl -s -L --noproxy '*' -o /dev/null -d switch<PORT>="1" -d d12="1" -d B1="Submit" http://<ADDRESS>/out_control.cgi

...and turning ON:
curl -s -L --noproxy '*' -o /dev/null -d switch<PORT>="1" -d d12="0" -d B1="Submit" http://<ADDRESS>/out_control.cgi

Couple of weeks ago, due to some changes, we have ordered another PDU from IntelliNet, which appears a new device also accessible via HTTP-only.

For it it looks slightly different.

State:
curl -s -L --noproxy '*' -o "<FILE>" -u "admin:admin" "http://<ADDRESS>/status.xml"
xmllint --xpath "//outletStat<PORT>/text()" "<FILE>" 2>/dev/null

OFF:
curl -s -L --noproxy '*' -o /dev/null -u admin:admin -X POST "http://<ADDRESS>/control_outlet.htm?op=1&outlet<PORT>=1&submit=Anwenden"

ON:
curl -s -L --noproxy '*' -o /dev/null -u admin:admin -X POST "http://<ADDRESS>/control_outlet.htm?op=0&outlet<PORT>=1&submit=Anwenden"

In all cases:
  • <ADDRESS>: IP or FQDN address of the PDU

  • <PORT>: power switch port, usually from 0 to 7

  • <FILE>: temporary file to cache the results, so one can get info for all ports on per port basis


  • This entry was originally posted at https://andy-shev.dreamwidth.org/152095.html. Please comment there using OpenID.

    Turning Minnowboard (v1) to life on vanilla kernel
    carstyle
    andy_shev
    Intel Minnowboard (v1) was one of the first Intel's attempts to create an open hardware (okay, to some extent, if we take all possible blobs into consideration) platform based on Intel CPU or SoC (in this case it's an Intel Atom E600 series with EG20T PCH).

    Minnowboard (v1)

    Linus Walleij, who was actively maintaining the GPIO subsystem, once sent a patch to convert PCH UDC (USB Device Controller) driver to use GPIO descriptor interface. However, the original code looks strange and seems never worked. It means that VBUS detection mechanism wasn't supported by the kernel. His patch didn't change that, only improved to use modern data structures and APIs. That time I have promised him that I will check the schematics and test it at some point.

    First part of the journey appears to be enabling IRQ on GPIO SCH controller, which is not quite usual in a sense of delivery to the OS. The (semi-)wrong assumption that the IRQ is shared with SCI, which is IRQ #9 for x86 case, brought up the wrong change ec689a8a8155 ("mfd: lpc_sch: Add support for Intel Quark X1000") in the kernel (yeah, sometimes product organizations focused on easier way to get job done, without deeper investigation involved). That change has been partially reverted in 922e8ce883e5 ("mfd: lpc_sch: Partially revert "Add support for Intel Quark X1000""). Thanks to Jan Kiszka from Siemens for pointing out to the issue and developing initial fix that landed in the kernel with 7a81638485c1 ("gpio: sch: Add edge event support").

    So, are we done? Nope! The second part is to fix GPIO in the UDC driver to be in align with the schematics, according to which (see page 4 D5 and page 8 B1-C2) it uses pin 12 (starting from 0, a.k.a. GPIO_SUS7) on that GPIO controller to detect VBUS. Hence the promised change to the driver 049d3db625a6 ("usb: gadget: pch_udc: Provide a GPIO line used on Intel Minnowboard (v1)") and its updated version dfc03e0bae86 ("usb: gadget: pch_udc: Use PCI sub IDs instead of DMI").

    Now we done, right? Not really. What about to test? Yes, the third part is to be sure that it indeed works. The astute reader already asks the question: Why do we need this at all? The board has separate connection for USB host and UDC, it should simply work!. Unfortunately no.

    There are possibilities regarding to how UDC should behave when the host is connected. One is to power the device (in our case the board itself) by VBUS, in other words to be USB self-powered device. This is not implemented in case of Minnowboard (v1). So another possibility is to detect VBUS to see when we actually got the host connection. But this is broken on... PCB level and hence doesn't work.

    Let's look again at the schematics. First of all on the page 8 B2-B3 the ~4:7 resistor divider (39 kOhm : 68 kOhm) is depicted. It's needed for the high voltage, which is +5v, to be converted to the chip level, which is +3.3v.

    VBUS sense

    So far so good. However, if we go to the page 19 C4 we will see... bootstrap pull-up 10 kOhm to +3.3v (with above 68 kOhm it gives us ~1:7 divider).

    GPIO SUS7 bootstrap

    Okay, let's assume we connected USB device to it which may consume up to 100 mA on the +5v line. By Ohm's law its resistance could be equal to 50 Ohm. In such case we will have 10 kOhm to +3.3v on one leg and 39 kOhm + 68 kOhm (like in parallel due to above "short circuit") on the other. It still gives us ~1:2.5 divider against +3.3v power rail. That's still well higher than the logical "1" threshold.

    Which means that VBUS detection is always high! The bootstrap is dedicated to detect the B1 stepping of the Intel Atom E600 SoC (see page 19 D2-D3). What to do in such case? I don't know the good answer because electrically it's not gonna work. Yes, we may use some timer logic or so to let the BIOS detect that, but I decided just to ignore the bootstrap, so I simply unsoldered R229 from the board. I hope somebody may fix the BIOS to just always assume the B1 stepping if it's not done yet.

    This entry was originally posted at https://andy-shev.dreamwidth.org/152628.html. Please comment there using OpenID.

    It's hard to get an ACPI ID
    proud
    andy_shev
    Historically and due to lack of knowledge about process the ACPI IDs for some devices are abusing the specification. As of today the v6.4 of it [1] says in the chapter 6.1.5 "_HID (Hardware ID)":

    A valid ACPI ID must be of the form “NNNN####” where N is an uppercase letter or a digit (‘0’-‘9’) and # is a hex digit. This specification reserves the string “ACPI” for use only with devices defined herein. It further reserves all strings representing 4 HEX digits for exclusive use with PCI-assigned Vendor IDs.



    Note that the first part of the ACPI ID is a Vendor ID which has to be in the official registry.

    However, we have a lot of IDs, including some of them issued by Intel, that do not follow that.

    Recently, while I cleaned up kernel from fake IDs [2] that hardware vendors never ever allocated for their devices (many of them simply don't care), it appears that Siemens on behalf of Seiko Epson was trying to establish yet another fake ID for their RTC discrete component in the Coreboot [3] and Linux kernel [4].

    Luckily they have listened to me and actually followed the process, i.e. they have asked Seiko Epson to register themselves in ACPI registry [5], which happens couple of month ago under the 'SECC' vendor (while it’s even better, I dunno why they haven't simply reused their PNP Vendor ID which is in the registry for ages). And they have allocated the proper ID, SECC6110, for their RX6110SA component.

    Now the patches for Coreboot (see [6]) and Linux kernel, as commit 8d69f62fddf6 ("rtc: rx6110: add ACPI bindings to I2C"), are accepted.

    I really wish that all hardware vendors will follow this, including Intel (for the record, we improved a lot the ACPI ID allocation process and there shouldn’t be new cases).

    Funny thing that newly introduced ID for Alibaba abusing the specification due to potential collisions with real PCI IDs ('BABA' can be represented as 0xbaba).

    This entry was originally posted at https://andy-shev.dreamwidth.org/151340.html. Please comment there using OpenID.

    Ampire AC162AY or what can go wrong?
    carstyle
    andy_shev
    I have spent some time to get the proper pin layout for the 16x2 LCD from Ampire (the model is AC162AY, or 162A-1-D Rev.B). The problem begins with the different polarity of the power rails. I thought if the polarity is wrong, what else can be wrong? That's how I started my search on Internet without any positive results — all of the layouts have a standard power rail polarity, i.e. 1 — GND and 2 — Vcc. At the end it comes I wasted time. Only power rails are messed up, other than that everything seems standard and I got a text on the LCD.

    P.S> Found a PDF with photos of that LCD: https://fccid.io/W8F800920910/Internal-Photos/Internal-Photos-2-1406623.pdf

    This entry was originally posted at https://andy-shev.dreamwidth.org/150665.html. Please comment there using OpenID.

    А нужен ли ЖЖ?
    serious
    andy_shev
    Настолько редко захожу в ЖЖ, да и почти перестал читать свои подписки...

    This entry was originally posted at http://andy-shev.dreamwidth.org/150491.html. Please comment there using OpenID.
    Tags:

    Что же дальше?
    serious
    andy_shev
    Решил набросать мысли, которые, возможно, могут ответить на вопрос "что же дальше?"

    Успокоиться. Не должно быть никакой эйфории. Все материальные блага и документы должны быть описаны и сохранены.

    xВласть. Януковича и прочих бывших при власти ни в коем случае не убивать. Должны быть процессы, показательные, но справедливые.

    Тимошенко. Пусть лечится в Германии, ей не место во власти, лучше пусть будет каким-нибудь общественным деятелем, омбудсменом, к примеру.

    Люстрации. Необходимо широкомасштабное поле для люстраций. Причём под них должны попадать в независимости от политичской или иной принадлежностей.

    Злоупотребления. Пытаться нарыть материалы на власть имущих, в независимости кто они и какие заслуги имеют.

    Перевыборы. Однозначно и президентские, и парламентские с учётом проведенных люстраций.
    Должны появится те люди, которые были на майдане, которые себя зарекомендовали. Все, включая майдановцев и любых других, кто придёт ко власти в той или иной мере, обязаны понимать, любое мутное действие должно вызывать противодействие и публичность.

    Суд. Происходящее в судах и прочих органах должно быть прозрачно. В каждом суде стоит создавать микромайданы по сути, если видно, что дело шьётся белыми нитками. То есть должна быть возможность в легитимном поле влиять на судей.

    Коррупция. Как многие, особенно с востока страны, заявляли, мы сами у себя должны делать Европу. Так вот, факты требования или дачи взяток должны быть опубликованы. Самим взяток не давать!

    Олигархия. Отбирать, национализировать и т.п. предприятий делать не надо. Достаточно заставить выполнять всё, что касается социальных гарантий сотрудников, экологии и модернизации для улучшения условий труда.

    This entry was originally posted at http://andy-shev.dreamwidth.org/150156.html. Please comment there using OpenID.

    К размышлению: хитрый Шустер
    contemplative
    andy_shev
    В передаче от 22.11.2013 первым выступал известный Н.Я. Азаров. На время его выступления убрали лого "поддержки студии" (около 100 человек, если не ошибаюсь, которые по выборке примерно соответствуют всей стране). Подали также кадр, где некоторые давят на пультах кнопку "поддерживаю". Очевидно, что сверху поступило указание. Правда и верхов непонятно сколько ­— сплошная многовекторность...
    Так вот, помимо многочисленных ляпов "по Фрейду" пана Азарова, по-моему вполне ясно, что вся идея похода в Европу — сплошная профанация. Но и со стороны Европы не совсем правильно говорить, что "не Европа тянет к себе Украину, а Украина хочет в Европу". Ведь для Европы Украина некий краеугольный камень как геополитики, так и ресурсов (в основном земельных). Лакомый кусочек для хозяина, но Россия — не хозяин. Одно в этом всём радует: текущая украинская власть играет в lose-lose. Если в Европу с европейскими ценностями, то их посадят с конфискацией рано или поздно. Если же в Россию, то зачем царю Владимиру Владимировичу сильные, свободомыслящие губернаторы?

    This entry was originally posted at http://andy-shev.dreamwidth.org/149849.html. Please comment there using OpenID.

    Dreamwidth.Org
    proud
    andy_shev
    So, finally I've moved to dreamwidth.org. I set up crossposting, but I prefer to use Dreamwidth engine instead of LJ.

    This entry was originally posted at http://andy-shev.dreamwidth.org/149513.html. Please comment there using OpenID.