mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Cameron Ferguson <cameron.bare86@gmail.com>, barebox@lists.infradead.org
Subject: Re: Small tweak to get ACPI watchdog working (iTCO)
Date: Wed, 29 Jan 2020 17:57:46 +0100	[thread overview]
Message-ID: <fead3df7-e831-8ff2-3f62-801ead7eda7b@pengutronix.de> (raw)
In-Reply-To: <CAEKVsgYu15u7d6ptaU7aZGy6OXOhN7743aLdGOz_3fZOPK2JpQ@mail.gmail.com>

Hello,

On 1/29/20 5:07 PM, Cameron Ferguson wrote:
>> I don't understand where this 0x10000 comes from. x86 I/O ports are 16-bits.
> 
> In order to write to ACPI addres 0x460, I can do this:
> 
>     *(unsigned *)(0x10460) = 0;
> This works fine on x86.

In the code you sent last time, it said that your addresses
are IORESOURCE_IO. These are I/O ports, not memory-mapped ports,
so you can't dereference a pointer and access them, but instead you
have to use port I/O instruction, which in barebox and Linux is
the out[bwl] family of functions.

> Barebox is missing the function "acpi_get_table". I briefly looked
> into copying it from the Linux kernel but after a few minutes I just
> decided to copy the hex values and hard-code them into my program.

barebox passes the table to the drivers, look in the acpi-test.c
example, how it gets the sdt pointer. That should be the one you
are after.                                                              

> I'm still tinkering about with this. Still no joy. Here's what I have now:

That's too much code to read through.. I suspect you are just clobbering random
memory, when you should be writing I/O ports instead.

Cheers
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-01-29 16:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEKVsgZHZR2b28wcMcpac4Qa3KebrXMRf14STZ8GCum0NmnLgg@mail.gmail.com>
2020-01-28 15:19 ` Cameron Ferguson
2020-01-29  8:36   ` Cameron Ferguson
2020-01-29 11:20 ` Ahmad Fatoum
2020-01-29 16:07   ` Cameron Ferguson
2020-01-29 16:57     ` Cameron Ferguson
2020-01-29 16:57     ` Ahmad Fatoum [this message]
2020-01-29 17:55       ` Cameron Ferguson
2020-01-29 18:00         ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fead3df7-e831-8ff2-3f62-801ead7eda7b@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=cameron.bare86@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox