# acpi, DSDT and RAM upgrade on a acer TM4001 [SOLVED]

## ubik15

I've got some problem with my laptop.

After upgrading the RAM, adding a 512MB bank, the acpi isn't working any more.

If you modify the ammount of memory, you have to modify the DSDT source code.

DSDT with 512MB:

```

/*

 * Intel ACPI Component Architecture

 * AML Disassembler version 20050930

 *

 * Disassembly of dsdt.aml, Wed Nov  9 12:44:11 2005

 */

DefinitionBlock ("DSDT.aml", "DSDT", 1, "ACER  ", "Kestrel ", 537004297)

{

    OperationRegion (PORT, SystemIO, 0x80, 0x02)

    Field (PORT, ByteAcc, NoLock, Preserve)

    {

        P80H,   8, 

        P81H,   8

    }

    OperationRegion (IO_T, SystemIO, 0x0800, 0x10)

    Field (IO_T, ByteAcc, NoLock, Preserve)

    {

        TRP0,   8

    }

    OperationRegion (MNVS, SystemMemory, 0x1FEECE59, 0x60)   <--- NOTE THIS LINE

    Field (MNVS, AnyAcc, Lock, Preserve)

    {

        OSYS,   16, 

        SMIF,   8, 

        SCIF,   8, 

 ...

 ...

  OperationRegion (SMI0, SystemIO, 0x0000FE00, 0x00000002)

                Field (SMI0, AnyAcc, NoLock, Preserve)

                {

                    SMIC,   8

                }

                OperationRegion (SMI1, SystemMemory, 0x1FEFCEBD, 0x00000090)   <--- AND THIS LINE

                Field (SMI1, AnyAcc, NoLock, Preserve)

                {

                    BCMD,   8, 

                    DID,    32, 

                    INFO,   1024

                }

                Field (SMI1, AnyAcc, NoLock, Preserve)

                {

                    AccessAs (ByteAcc, 0x00), 

                    Offset (0x05), 

                    INF,    8

                }

            }

            Device (MDM0)

            {

                Name (_ADR, 0x001F0006)

                Name (_PRW, Package (0x02)

                {

                    0x05, 

                    0x03

 ...

```

DSDT with 768MB:

```

/*

 * Intel ACPI Component Architecture

 * AML Disassembler version 20050930

 *

 * Disassembly of dsdt.aml, Wed Nov  9 12:44:11 2005

 */

DefinitionBlock ("DSDT.aml", "DSDT", 1, "ACER  ", "Kestrel ", 537004297)

{

    OperationRegion (PORT, SystemIO, 0x80, 0x02)

    Field (PORT, ByteAcc, NoLock, Preserve)

    {

        P80H,   8, 

        P81H,   8

    }

    OperationRegion (IO_T, SystemIO, 0x0800, 0x10)

    Field (IO_T, ByteAcc, NoLock, Preserve)

    {

        TRP0,   8

    }

    OperationRegion (MNVS, SystemMemory, 0x2FEECE59, 0x60)   <--- NOTE THIS LINE

    Field (MNVS, AnyAcc, Lock, Preserve)

    {

        OSYS,   16, 

        SMIF,   8, 

        SCIF,   8, 

 ...

 ...

  OperationRegion (SMI0, SystemIO, 0x0000FE00, 0x00000002)

                Field (SMI0, AnyAcc, NoLock, Preserve)

                {

                    SMIC,   8

                }                                                                    

                OperationRegion (SMI1, SystemMemory, 0x2FEFCEBD, 0x00000090)   <--- AND THIS LINE

                Field (SMI1, AnyAcc, NoLock, Preserve)

                {

                    BCMD,   8, 

                    DID,    32, 

                    INFO,   1024

                }

                Field (SMI1, AnyAcc, NoLock, Preserve)

                {

                    AccessAs (ByteAcc, 0x00), 

                    Offset (0x05), 

                    INF,    8

                }

            }

            Device (MDM0)

            {

                Name (_ADR, 0x001F0006)

                Name (_PRW, Package (0x02)

                {

                    0x05, 

                    0x03

 ...

```

Infact, without these changings, acpi will give a lot of errors.

Now, the acpi seems to work (according to dmesg), but in /proc/acpi/something I have nothing (for example /proc/acpi/battery/ is empty).

What should I do to have the acpi back working?

ByeLast edited by ubik15 on Mon Dec 26, 2005 2:33 pm; edited 1 time in total

----------

## widan

 *ubik15 wrote:*   

> After upgrading the RAM, adding a 512MB bank, the acpi isn't working any more.
> 
> If you modify the ammount of memory, you have to modify the DSDT source code.

 

The BIOS is probably hardcoding the position of an ACPI data area (that is usually near the end of the RAM) in the DSDT. How much memory do you have now ? 768 MB ?

```
512: OperationRegion (MNVS, SystemMemory, 0x1FEECE59, 0x60)

768: OperationRegion (MNVS, SystemMemory, 0x2FEECE59, 0x60)
```

It's at a constant offset from the end of memory:

```
0x1feece59 = 0x20000000 - 0x001131a7 (0x20000000 = 512 MB in hexadecimal)

0x2feece59 = 0x30000000 - 0x001131a7 (0x30000000 = 768 MB in hexadecimal)
```

```
512: OperationRegion (SMI1, SystemMemory, 0x1FEFCEBD, 0x00000090)

768: OperationRegion (SMI1, SystemMemory, 0x2FEFCEBD, 0x00000090)
```

Same thing here, except the offset is different.

 *ubik15 wrote:*   

> Now, the acpi seems to work (according to dmesg), but in /proc/acpi/something I have nothing (for example /proc/acpi/battery/ is empty).

 

Maybe there is another place with a hardcoded value that you missed ? Try to search for values starting in 0x1fe (or even simply 0x1f), and change them like the others (add 0x10000000 per 256 MB additional RAM compared to the original).

----------

## ubik15

Well, yes, now I have 768MB (previously I had 512MB in two banks of 256MB each, but I had to remove one of the bank to add the new memory).

I'm quite sure that these are the only two points that need to be changed, but I will check more deeply.

Thanks

----------

## ubik15

After decompiling and recompiling my DSDT, now I'm quite sure that the DSDT is working fine.

But I still have the same problem: /proc/acpi/ac_adapter and /proc/acpi/battery are empty; /proc/acpi/others contain something, but I think the information returned are wrong.

Help plz!!!   :Sad: 

----------

## ubik15

Problem solved!!!

The issue was that ACER laptop like mine (Travelmate 4001) use the SBS (SmartBattery) tecnology. So you have to patch your dsdt also when you extract it from your own kernel.

(more details at https://forums.gentoo.org/viewtopic.php?t=122145)

Step by step:

1. extract dsdt from the kernel:

```
# cat /proc/acpi/dsdt > dsdt.dat
```

2. disassemble the source code:

```
# iasl -d dsdt.dat
```

3. modify the original dsdt (dsdt.dsl) to correct the errors (you can find what need to be fixed recompiling the file dsdt.dsl with iasl);

4. download the SBS patch from http://sourceforge.net/projects/sbs-linux;

5. decompress the tar file and copy all the .asl and the right .diff (example: acer-tm4xxx-sbs-cm.diff) files in the same directory where you have the dsdt.dsl;

6. patch the fixed dsdt.dsl:

```
# patch <acer-tm4xxx-sbs-cm.diff

   patching file dsdt.dsl
```

7. compile the fixed and patched dsdt.dsl:

```
# iasl -tc dsdt.dsl
```

8. Done! Now you can load the DSDT.aml using initrd or patching the kernel.

Bye!

----------

## opotonil

SBS support in Kernel 2.6.18

 *Quote:*   

> 
> 
> Fortunately for all users of the Smart Battery stuff, there's now no longer any need to mess around with patching your DSDT. Based on a much-fixed-up version of kernel code that I developed as a proof-of-concept (before I turned to the DSDT patch approach implemented here), the 2.6.18 Linux kernel now incorporates a module that handles all of the Smart Battery stuff. This module wholly replaces the SBS-CM patches, and therefore there will not be any further development of these patches. 
> 
> 

 

[url]

http://sourceforge.net/forum/forum.php?forum_id=604605

[/url]

----------

## ubik15

Actually I'm using a 2.6.18-viper kernel, and the SBS is working fine with no more need to patch the kernel.

----------

