diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-03-21 07:31:21 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-04-04 21:07:13 -0400 |
commit | ec64a40868469d308ad1e040c6ead2373af334dd (patch) | |
tree | b947095cdf77810e75fe178780bc668b4050316d /drivers/gpu/drm/nouveau/nouveau_bios.c | |
parent | fb522ee1aa57f2bb57ebd1111524601076d9ad0a (diff) |
drm/nouveau: implement init table opcode 0x5c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 8314a49b6b9a..eca191accb6a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -269,7 +269,7 @@ struct init_tbl_entry { | |||
269 | int (*handler)(struct nvbios *, uint16_t, struct init_exec *); | 269 | int (*handler)(struct nvbios *, uint16_t, struct init_exec *); |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int parse_init_table(struct nvbios *, unsigned int, struct init_exec *); | 272 | static int parse_init_table(struct nvbios *, uint16_t, struct init_exec *); |
273 | 273 | ||
274 | #define MACRO_INDEX_SIZE 2 | 274 | #define MACRO_INDEX_SIZE 2 |
275 | #define MACRO_SIZE 8 | 275 | #define MACRO_SIZE 8 |
@@ -2011,6 +2011,27 @@ init_sub_direct(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | |||
2011 | } | 2011 | } |
2012 | 2012 | ||
2013 | static int | 2013 | static int |
2014 | init_jump(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | ||
2015 | { | ||
2016 | /* | ||
2017 | * INIT_JUMP opcode: 0x5C ('\') | ||
2018 | * | ||
2019 | * offset (8 bit): opcode | ||
2020 | * offset + 1 (16 bit): offset (in bios) | ||
2021 | * | ||
2022 | * Continue execution of init table from 'offset' | ||
2023 | */ | ||
2024 | |||
2025 | uint16_t jmp_offset = ROM16(bios->data[offset + 1]); | ||
2026 | |||
2027 | if (!iexec->execute) | ||
2028 | return 3; | ||
2029 | |||
2030 | BIOSLOG(bios, "0x%04X: Jump to 0x%04X\n", offset, jmp_offset); | ||
2031 | return jmp_offset - offset; | ||
2032 | } | ||
2033 | |||
2034 | static int | ||
2014 | init_i2c_if(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | 2035 | init_i2c_if(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) |
2015 | { | 2036 | { |
2016 | /* | 2037 | /* |
@@ -3659,6 +3680,7 @@ static struct init_tbl_entry itbl_entry[] = { | |||
3659 | { "INIT_ZM_REG_SEQUENCE" , 0x58, init_zm_reg_sequence }, | 3680 | { "INIT_ZM_REG_SEQUENCE" , 0x58, init_zm_reg_sequence }, |
3660 | /* INIT_INDIRECT_REG (0x5A, 7, 0, 0) removed due to no example of use */ | 3681 | /* INIT_INDIRECT_REG (0x5A, 7, 0, 0) removed due to no example of use */ |
3661 | { "INIT_SUB_DIRECT" , 0x5B, init_sub_direct }, | 3682 | { "INIT_SUB_DIRECT" , 0x5B, init_sub_direct }, |
3683 | { "INIT_JUMP" , 0x5C, init_jump }, | ||
3662 | { "INIT_I2C_IF" , 0x5E, init_i2c_if }, | 3684 | { "INIT_I2C_IF" , 0x5E, init_i2c_if }, |
3663 | { "INIT_COPY_NV_REG" , 0x5F, init_copy_nv_reg }, | 3685 | { "INIT_COPY_NV_REG" , 0x5F, init_copy_nv_reg }, |
3664 | { "INIT_ZM_INDEX_IO" , 0x62, init_zm_index_io }, | 3686 | { "INIT_ZM_INDEX_IO" , 0x62, init_zm_index_io }, |
@@ -3700,8 +3722,7 @@ static struct init_tbl_entry itbl_entry[] = { | |||
3700 | #define MAX_TABLE_OPS 1000 | 3722 | #define MAX_TABLE_OPS 1000 |
3701 | 3723 | ||
3702 | static int | 3724 | static int |
3703 | parse_init_table(struct nvbios *bios, unsigned int offset, | 3725 | parse_init_table(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) |
3704 | struct init_exec *iexec) | ||
3705 | { | 3726 | { |
3706 | /* | 3727 | /* |
3707 | * Parses all commands in an init table. | 3728 | * Parses all commands in an init table. |