From owner-freebsd-current@freebsd.org Tue Jun 14 01:56:27 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93D53AF2465 for ; Tue, 14 Jun 2016 01:56:27 +0000 (UTC) (envelope-from johannes@brilliantservice.co.jp) Received: from mail-vk0-x22c.google.com (mail-vk0-x22c.google.com [IPv6:2607:f8b0:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7722E6B for ; Tue, 14 Jun 2016 01:56:27 +0000 (UTC) (envelope-from johannes@brilliantservice.co.jp) Received: by mail-vk0-x22c.google.com with SMTP id d185so78588291vkg.0 for ; Mon, 13 Jun 2016 18:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brilliantservice-co-jp.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T7RxRMMRTVjphRduTxodbFB18m7TiEDsaBnZzn5UPMc=; b=crpGbIH7nnxgA/2fKn27ShjxWRNnBzb6TXnwLeGZaB+98bktLebGucC6nlG/QCkBYN QT9kSyz5LFS4V2fYJrZs2aA8wjDbi6mIG81sMUsSPdwf3dvDiD3cJDgJ/LyHa9oGFobx 1eEuIAYxSVp3whd4YXV05wnpXLs6FjwKTtijdsgMxhW2CXu5WAom7dkKdc9UQju4vE0z w/R3LJrCZqYlvJKhur9+xivZ0KRefx5uAt6F+K+q7UbKnx2m+cGQ9ADLtn4GqNtIw4ud M38Z8IMOITeHS4SBDgO96a8kA9ocubod8H0zIXp9yNS55HZy/mQX8vE0he/DBWGS5OHD B76w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T7RxRMMRTVjphRduTxodbFB18m7TiEDsaBnZzn5UPMc=; b=knY9f4Lw4nHLzj6MAcwnl3LAUf5pSVcGrs4v8Mw8j2MFJrM+A8gIlAtC25WP344mPD +KJVOLoLQFsOHI+XBG2Loshs0wnA1/bIlzTHWiP/qJecaE9F1mXFmMspZu0x3nyCzXHG 9d9DRRaJ5UN7Dkb99jl4Qr55SOcts3QzhkVntxhL9D/nU8GDJLBq2HVp59E5aGrnNkkA 3XagSnKSvSbxtMxxWnYZ2eRX2X3AVGgONW47yOPYYYqyB/RtSRbPlSOs/OnM1VWMQFjN BANIZEXUjq7JdbF5RoF+hugU2N9/nbqhwNbnChQaGwyZGsCl0hwdhdjN4zc2I76qI1lZ +24w== X-Gm-Message-State: ALyK8tI1j7EdHDan9DfRRXpd+RoU2eNWPB4PaV9ZhEkFmYOgz4U/uZUDyS9H4pAXXcJSo+NtQ0t2l1YeHjGPCf+ycGo+7SrQzZ6XY/WP/mIpgTtiLCFdNqpLgYrnmwZo621vFkGFIRKmsl9by49sJ9Q/ol8= X-Received: by 10.31.222.197 with SMTP id v188mr8239122vkg.101.1465869386096; Mon, 13 Jun 2016 18:56:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.40.33 with HTTP; Mon, 13 Jun 2016 18:56:11 -0700 (PDT) In-Reply-To: <20160613215615.GA163376@polaris.intra.vdsz.de> References: <20160613093857.GA157051@polaris.intra.vdsz.de> <20160613193644.GA161421@polaris.intra.vdsz.de> <20160613215615.GA163376@polaris.intra.vdsz.de> From: "Lundberg, Johannes" Date: Mon, 13 Jun 2016 18:56:11 -0700 Message-ID: Subject: Re: GPIO driver for Intel Atom SoC To: Imre Vadasz Cc: FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 01:56:27 -0000 Hi Imre I got the device in /dev/mmcsd0. I think the reason was that mmcsd wasn't loaded (need to load manually it seems..) Do you think your patch in mmc is something that should be pushed upstream in FreeBSD or is it more of a hack? I am talking about https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/444adb3ea= b999964539da816dc292a2ad058918c On Mon, Jun 13, 2016 at 2:56 PM, Imre Vadasz wrote: > Hi, > > Having the SDHCI controller in ACPI space won't help, because FreeBSD > doesn't have the code for attaching sdhci(4) via acpi yet. > > You should try setting the hw.mmc.debug tunable in the bootloader. > You should probably try booting with hw.mmc.debug=3D3 to get as much > debugging output as possible from mmc(4). It should at least tell you > if/how it recognizes the eMMC disk, and maybe something helpful for > further debugging. > > Imre > > On 13:44 Mon 13 Jun , Lundberg, Johannes wrote: > > Hi Imre > > > > > > I have attached the logs. > > The board is this: http://www.up-board.org/ > > > > Since we don't have sdhci_acpi.c (yet) I select the SDHCI controller to > be > > on PCI in BIOS. > > Would it be better to have it in ACPI space because of the MMC/GPIO > stuff? > > > > > > I tried your patch and amazingly identification of the mmc card now > works!! > > I can't believe it was that simple... > > However, I do not get any /dev/mmc* devices. > > > > sdhci_pci0: mem > > 0x91927000-0x91927fff at device 16.0 on pci0 > > sdhci_pci0: 1 slot(s) allocated > > mmc0: on sdhci_pci0 > > > > Thanks! > > > > > > > > -- > > Name: Johannes Lundberg > > Position: Mirama project leader > > Phone: +1-408-636-2161 > > Skype: brilliantjohannes > > Online: LinkedIn Faceboo= k > > Reddit > > Twitter > > GitHub < > https://github.com/yohanesu75> > > GitLab > > Company: Mirama Brilliantservice US > > Brilliantservice JP > > > > > > On Mon, Jun 13, 2016 at 12:36 PM, Imre Vadasz wrote: > > > > > Hi, > > > > > > If possible, it would be quite interesting and helpful if you could > post > > > the ACPI tables of your device (i.e. by running "acpidump -b" and > uploading > > > the output files), as well as the list of pci devices from "pciconf > -lcvb". > > > > > > The HP X2 210 detachable I'm running DragonFly on, has an internal eM= MC > > > on its pcb, as well as an external micro-sdcard slot, and both work > for me. > > > I forgot to mention that I need a small workaround to make the eMMC > work, > > > which you could try out: > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/444adb3= eab999964539da816dc292a2ad058918c > > > > > > It seems quite unlikely that the mmc would need activating through a > gpio, > > > assuming your device can boot from that internal mmc. > > > > > > My HP detachable can boot from the internal eMMC, but not from the > external > > > micro-sd slot. The micro-sd slot is powered on by the _PS0 ACPI metho= d > of > > > the corresponding ACPI device, and that _PS0 method does some I2C > > > transactions through an I2cSerialBus ACPI operation-region Field. For > that > > > part I added a helper driver which installs the necessary handler > function > > > in the ACPICA framework: > > > > > > > https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/98eefd6fca52090f= e45779e35c41f4b15942517f > > > > > > Imre > > > > > > On 11:24 Mon 13 Jun , Lundberg, Johannes wrote: > > > > Hi Imre > > > > > > > > This is great information. Thank you! > > > > > > > > My device have an emmc chip on the pcb (non-removable). > > > > Have you tested you code on that kind of system? > > > > > > > > Current unmodified FreeBSD can detect the sdhci_pci controller and = a > mmc > > > > card on slot0 but timeouts when trying to init the mmc. Not sure wh= y > it > > > is > > > > failing. I assumed it needed activating through some gpios but mayb= e > it's > > > > not that easy.. > > > > > > > > > > > > On Mon, Jun 13, 2016 at 2:38 AM, Imre Vadasz wrote: > > > > > > > > > Hi, > > > > > > > > > > Microsoft has some documentation on GPIO handling with SD card > > > controllers, > > > > > which should apply to most Cherryview devices: > > > > > > > > > > > > > > https://msdn.microsoft.com/windows/hardware/drivers/bringup/other-acpi-na= mespace-objects#sd > > > > > > > > > > I did some work on Cherryview SoC support in DragonFlyBSD. > > > > > In DragonFly master, there is a simple GPIO driver for cherryview > in > > > > > /sys/bus/gpio/gpio_intel. In master, it's currently only used for > > > > > handling the ACPI GeneralPurposeIo operation regions, and > > > > > Acpi-Event-Interrupts (which replace GPE interrupts on > reduced-hardware > > > > > platforms). > > > > > > > > > > I have some further (more prototype level) code which also contai= ns > > > some > > > > > code for Intel sdhci controller integration: > > > > > > > > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/shortlog/refs/head= s/cherryview > > > > > > > > > > With this branch everything sdcard/eMMC related works quite nicel= y, > > > e.g. > > > > > it properly handles plugging in/out the sd-card on my HP X2 210 > > > detachable > > > > > on DragonFlyBSD. > > > > > > > > > > To handle everything properly this contains a bit of work on most= ly > > > ACPI > > > > > related stuff: > > > > > > > > > > ACPI device initialization order needs to be according to the ACP= I > _DEP > > > > > methods: > > > > > > > > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/25dec08= cafa3ce9089eb5b216700f4e678b3356d > > > > > > > > > > We need to map ACPI nodes to the device objects (and at least > track a > > > > > reference count for debugging): > > > > > > > > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/2313559= 0ffb33b40f170c786ea95fc133358ebdb > > > > > > > > > > Then some kind of API is needed for handling the GeneralPurposeIo > > > resources > > > > > declared for the device in the ACPI tables (e.g. the sdhci > controller). > > > > > (i.e. some way of attempting to "map" the resource from the devic= e > > > driver): > > > > > > > > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/d5b3d34= 47bbdd42a68359aebd61f271bfa830951 > > > > > > > > > > And I have a prototype of adapting the sdhci driver to handle the > GPIO > > > > > ACPI resources, as described in " > > > > > > > > > https://msdn.microsoft.com/windows/hardware/drivers/bringup/other-acpi-na= mespace-objects#sd > > > > > ": > > > > > > > > > > > > > > https://gitweb.dragonflybsd.org/~ivadasz/dragonfly.git/commitdiff/5d2844c= 280211cbb256a5ecc3ea27f952149e452 > > > > > > > > > > Regards, > > > > > Imre Vad=C3=A1sz > > > > > > > > > > > > > -- > > > > =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > > > =E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3= =81=A6=EF=BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83= =AB=E3=81=AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1= =E3=81=97=E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7= =A7=98=E5=8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81= =AA=E3=82=8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84= =E3=81=BE=E3=81=99=E3=80=82 > > > > =E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5= =A4=96=E3=81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81= =9F=E5=A0=B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB= =E3=81=AE=E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3= =81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8= =80=E5=88=87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81 > > > > =E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3= =81=AE=E4=BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81= =AF=E8=A8=98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F= =E3=81=84=E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3= =82=8C=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94= =B3=E3=81=97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82 > > > > --- > > > > CONFIDENTIALITY NOTE: The information in this email is confidential > > > > and intended solely for the addressee. > > > > Disclosure, copying, distribution or any other action of use of thi= s > > > > email by person other than intended recipient, is prohibited. > > > > If you are not the intended recipient and have received this email = in > > > > error, please destroy the original message. > > > > > > > -- > > =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > =E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3=81= =A6=EF=BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83=AB= =E3=81=AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1=E3= =81=97=E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7=A7= =98=E5=8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=AA= =E3=82=8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84=E3= =81=BE=E3=81=99=E3=80=82 > > =E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5=A4= =96=E3=81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81=9F= =E5=A0=B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3= =81=AE=E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3=81= =AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8=80= =E5=88=87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81 > > =E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3=81= =AE=E4=BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81=AF= =E8=A8=98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F=E3= =81=84=E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3=82= =8C=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94=B3= =E3=81=97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82 > > --- > > CONFIDENTIALITY NOTE: The information in this email is confidential > > and intended solely for the addressee. > > Disclosure, copying, distribution or any other action of use of this > > email by person other than intended recipient, is prohibited. > > If you are not the intended recipient and have received this email in > > error, please destroy the original message. > > > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- =E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=EF= =BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83=AB=E3=81= =AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1=E3=81=97= =E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7=A7=98=E5= =8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=AA=E3=82= =8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84=E3=81=BE= =E3=81=99=E3=80=82 =E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5=A4=96=E3= =81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81=9F=E5=A0= =B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE= =E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3=81=AE=E3= =83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8=80=E5=88= =87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81 =E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3=81=AE=E4= =BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81=AF=E8=A8= =98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F=E3=81=84= =E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3=82=8C=E3= =81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94=B3=E3=81= =97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82 --- CONFIDENTIALITY NOTE: The information in this email is confidential and intended solely for the addressee. Disclosure, copying, distribution or any other action of use of this email by person other than intended recipient, is prohibited. If you are not the intended recipient and have received this email in error, please destroy the original message.