drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
/*
* Copyright 2012 Red Hat Inc .
*
* Permission is hereby granted , free of charge , to any person obtaining a
* copy of this software and associated documentation files ( the
* " Software " ) , to deal in the Software without restriction , including
* without limitation the rights to use , copy , modify , merge , publish ,
* distribute , sub license , and / or sell copies of the Software , and to
* permit persons to whom the Software is furnished to do so , subject to
* the following conditions :
*
* THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
* IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
* FITNESS FOR A PARTICULAR PURPOSE AND NON - INFRINGEMENT . IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS , AUTHORS AND / OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM ,
* DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR
* OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE .
*
* The above copyright notice and this permission notice ( including the
* next paragraph ) shall be included in all copies or substantial portions
* of the Software .
*
*/
/*
* Authors : Dave Airlie < airlied @ redhat . com >
*/
2019-06-30 08:19:21 +02:00
# include <linux/pci.h>
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2019-11-07 09:34:04 +01:00
# include <drm/drm_atomic_helper.h>
2020-07-30 15:52:00 +02:00
# include <drm/drm_drv.h>
2019-06-30 08:19:21 +02:00
# include <drm/drm_gem.h>
2020-07-30 15:52:05 +02:00
# include <drm/drm_managed.h>
2019-06-30 08:19:21 +02:00
# include "ast_drv.h"
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2023-06-21 14:53:47 +02:00
static void ast_detect_widescreen ( struct ast_device * ast )
{
u8 jreg ;
2014-09-04 17:50:11 +10:00
/* Check if we support wide screen */
2023-06-21 14:53:43 +02:00
switch ( AST_GEN ( ast ) ) {
case 1 :
2014-01-17 10:56:09 +10:00
ast - > support_wide_screen = false ;
break ;
default :
2023-10-17 10:32:05 +02:00
jreg = ast_get_index_reg_mask ( ast , AST_IO_VGACRI , 0xd0 , 0xff ) ;
2014-01-17 10:56:09 +10:00
if ( ! ( jreg & 0x80 ) )
ast - > support_wide_screen = true ;
else if ( jreg & 0x01 )
ast - > support_wide_screen = true ;
else {
ast - > support_wide_screen = false ;
2023-06-21 14:53:44 +02:00
if ( ast - > chip = = AST1300 )
2017-02-17 14:33:01 +11:00
ast - > support_wide_screen = true ;
2023-06-21 14:53:45 +02:00
if ( ast - > chip = = AST1400 )
2017-02-17 14:33:01 +11:00
ast - > support_wide_screen = true ;
2023-06-21 14:53:46 +02:00
if ( ast - > chip = = AST2510 )
2017-02-17 14:36:46 +11:00
ast - > support_wide_screen = true ;
2023-06-21 14:53:43 +02:00
if ( IS_AST_GEN7 ( ast ) )
2021-12-29 16:27:49 +08:00
ast - > support_wide_screen = true ;
2014-01-17 10:56:09 +10:00
}
break ;
}
2023-06-21 14:53:47 +02:00
}
static void ast_detect_tx_chip ( struct ast_device * ast , bool need_post )
{
struct drm_device * dev = & ast - > base ;
u8 jreg ;
2014-01-17 10:56:09 +10:00
2014-09-04 17:50:11 +10:00
/* Check 3rd Tx option (digital output afaik) */
2022-06-07 11:20:04 +02:00
ast - > tx_chip_types | = AST_TX_NONE_BIT ;
2014-09-04 17:50:11 +10:00
/*
* VGACRA3 Enhanced Color Mode Register , check if DVO is already
* enabled , in that case , assume we have a SIL164 TMDS transmitter
2014-09-04 17:50:21 +10:00
*
* Don ' t make that assumption if we the chip wasn ' t enabled and
* is at power - on reset , otherwise we ' ll incorrectly " detect " a
* SIL164 when there is none .
2014-09-04 17:50:11 +10:00
*/
2023-06-21 14:53:39 +02:00
if ( ! need_post ) {
2023-10-17 10:32:05 +02:00
jreg = ast_get_index_reg_mask ( ast , AST_IO_VGACRI , 0xa3 , 0xff ) ;
2014-09-04 17:50:21 +10:00
if ( jreg & 0x80 )
2022-06-07 11:20:04 +02:00
ast - > tx_chip_types = AST_TX_SIL164_BIT ;
2014-09-04 17:50:21 +10:00
}
2014-09-04 17:50:11 +10:00
2023-06-21 14:53:43 +02:00
if ( IS_AST_GEN4 ( ast ) | | IS_AST_GEN5 ( ast ) | | IS_AST_GEN6 ( ast ) ) {
2014-09-04 17:50:11 +10:00
/*
2023-06-21 14:53:43 +02:00
* On AST GEN4 + , look the configuration set by the SoC in
2014-09-04 17:50:11 +10:00
* the SOC scratch register # 1 bits 11 : 8 ( interestingly marked
2014-09-04 17:50:21 +10:00
* as " reserved " in the spec )
2014-09-04 17:50:11 +10:00
*/
2023-10-17 10:32:05 +02:00
jreg = ast_get_index_reg_mask ( ast , AST_IO_VGACRI , 0xd1 , 0xff ) ;
2014-03-28 11:05:12 +10:00
switch ( jreg ) {
case 0x04 :
2022-06-07 11:20:04 +02:00
ast - > tx_chip_types = AST_TX_SIL164_BIT ;
2014-03-28 11:05:12 +10:00
break ;
case 0x08 :
2020-07-30 15:52:05 +02:00
ast - > dp501_fw_addr = drmm_kzalloc ( dev , 32 * 1024 , GFP_KERNEL ) ;
2014-03-28 11:05:12 +10:00
if ( ast - > dp501_fw_addr ) {
/* backup firmware */
if ( ast_backup_fw ( dev , ast - > dp501_fw_addr , 32 * 1024 ) ) {
2020-07-30 15:52:05 +02:00
drmm_kfree ( dev , ast - > dp501_fw_addr ) ;
2014-03-28 11:05:12 +10:00
ast - > dp501_fw_addr = NULL ;
}
}
2020-08-23 17:36:59 -05:00
fallthrough ;
2014-03-28 11:05:12 +10:00
case 0x0c :
2022-06-07 11:20:04 +02:00
ast - > tx_chip_types = AST_TX_DP501_BIT ;
2014-03-28 11:05:12 +10:00
}
2023-06-21 14:53:43 +02:00
} else if ( IS_AST_GEN7 ( ast ) ) {
2023-10-17 10:32:05 +02:00
if ( ast_get_index_reg_mask ( ast , AST_IO_VGACRI , 0xD1 , TX_TYPE_MASK ) = =
2023-05-30 12:12:40 +08:00
ASTDP_DPMCU_TX ) {
ast - > tx_chip_types = AST_TX_ASTDP_BIT ;
ast_dp_launch ( & ast - > base ) ;
}
}
2014-03-28 11:05:12 +10:00
2014-09-04 17:50:11 +10:00
/* Print stuff for diagnostic purposes */
2022-06-07 11:20:04 +02:00
if ( ast - > tx_chip_types & AST_TX_NONE_BIT )
drm_info ( dev , " Using analog VGA \n " ) ;
if ( ast - > tx_chip_types & AST_TX_SIL164_BIT )
2020-06-17 10:03:40 +02:00
drm_info ( dev , " Using Sil164 TMDS transmitter \n " ) ;
2022-06-07 11:20:04 +02:00
if ( ast - > tx_chip_types & AST_TX_DP501_BIT )
2020-06-17 10:03:40 +02:00
drm_info ( dev , " Using DP501 DisplayPort transmitter \n " ) ;
2023-05-30 12:12:40 +08:00
if ( ast - > tx_chip_types & AST_TX_ASTDP_BIT )
drm_info ( dev , " Using ASPEED DisplayPort transmitter \n " ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
}
static int ast_get_dram_info ( struct drm_device * dev )
{
2020-12-01 11:35:25 +01:00
struct device_node * np = dev - > dev - > of_node ;
2023-02-21 16:57:45 +01:00
struct ast_device * ast = to_ast_device ( dev ) ;
2017-02-17 14:33:01 +11:00
uint32_t mcr_cfg , mcr_scu_mpll , mcr_scu_strap ;
uint32_t denum , num , div , ref_pll , dsel ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2017-02-17 14:33:01 +11:00
switch ( ast - > config_mode ) {
case ast_use_dt :
/*
* If some properties are missing , use reasonable
2023-06-21 14:53:43 +02:00
* defaults for GEN5
2017-02-17 14:33:01 +11:00
*/
if ( of_property_read_u32 ( np , " aspeed,mcr-configuration " ,
& mcr_cfg ) )
mcr_cfg = 0x00000577 ;
if ( of_property_read_u32 ( np , " aspeed,mcr-scu-mpll " ,
& mcr_scu_mpll ) )
mcr_scu_mpll = 0x000050C0 ;
if ( of_property_read_u32 ( np , " aspeed,mcr-scu-strap " ,
& mcr_scu_strap ) )
mcr_scu_strap = 0 ;
break ;
case ast_use_p2a :
ast_write32 ( ast , 0xf004 , 0x1e6e0000 ) ;
ast_write32 ( ast , 0xf000 , 0x1 ) ;
mcr_cfg = ast_read32 ( ast , 0x10004 ) ;
mcr_scu_mpll = ast_read32 ( ast , 0x10120 ) ;
mcr_scu_strap = ast_read32 ( ast , 0x10170 ) ;
break ;
case ast_use_defaults :
default :
2017-01-26 09:45:40 +08:00
ast - > dram_bus_width = 16 ;
ast - > dram_type = AST_DRAM_1Gx16 ;
2023-06-21 14:53:43 +02:00
if ( IS_AST_GEN6 ( ast ) )
2017-02-17 14:36:46 +11:00
ast - > mclk = 800 ;
else
ast - > mclk = 396 ;
2017-02-17 14:33:01 +11:00
return 0 ;
2017-01-26 09:45:40 +08:00
}
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2017-02-17 14:33:01 +11:00
if ( mcr_cfg & 0x40 )
ast - > dram_bus_width = 16 ;
else
ast - > dram_bus_width = 32 ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2023-06-21 14:53:43 +02:00
if ( IS_AST_GEN6 ( ast ) ) {
2017-02-17 14:36:46 +11:00
switch ( mcr_cfg & 0x03 ) {
case 0 :
ast - > dram_type = AST_DRAM_1Gx16 ;
break ;
default :
case 1 :
ast - > dram_type = AST_DRAM_2Gx16 ;
break ;
case 2 :
ast - > dram_type = AST_DRAM_4Gx16 ;
break ;
case 3 :
ast - > dram_type = AST_DRAM_8Gx16 ;
break ;
}
2023-06-21 14:53:43 +02:00
} else if ( IS_AST_GEN4 ( ast ) | | IS_AST_GEN5 ( ast ) ) {
2017-02-17 14:33:01 +11:00
switch ( mcr_cfg & 0x03 ) {
case 0 :
ast - > dram_type = AST_DRAM_512Mx16 ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
break ;
2017-02-17 14:33:01 +11:00
default :
2017-01-26 09:45:40 +08:00
case 1 :
2017-02-17 14:33:01 +11:00
ast - > dram_type = AST_DRAM_1Gx16 ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
break ;
2017-02-17 14:33:01 +11:00
case 2 :
ast - > dram_type = AST_DRAM_2Gx16 ;
break ;
case 3 :
ast - > dram_type = AST_DRAM_4Gx16 ;
break ;
}
} else {
switch ( mcr_cfg & 0x0c ) {
case 0 :
case 4 :
ast - > dram_type = AST_DRAM_512Mx16 ;
break ;
case 8 :
if ( mcr_cfg & 0x40 )
ast - > dram_type = AST_DRAM_1Gx16 ;
else
ast - > dram_type = AST_DRAM_512Mx32 ;
break ;
case 0xc :
ast - > dram_type = AST_DRAM_1Gx32 ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
break ;
}
}
2017-02-17 14:33:01 +11:00
if ( mcr_scu_strap & 0x2000 )
ref_pll = 14318 ;
else
ref_pll = 12000 ;
denum = mcr_scu_mpll & 0x1f ;
num = ( mcr_scu_mpll & 0x3fe0 ) > > 5 ;
dsel = ( mcr_scu_mpll & 0xc000 ) > > 14 ;
switch ( dsel ) {
case 3 :
div = 0x4 ;
break ;
case 2 :
case 1 :
div = 0x2 ;
break ;
default :
div = 0x1 ;
break ;
}
2017-02-17 13:57:30 +11:00
ast - > mclk = ref_pll * ( num + 2 ) / ( ( denum + 2 ) * ( div * 1000 ) ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
return 0 ;
}
2023-11-16 10:59:29 +01:00
struct drm_device * ast_device_create ( struct pci_dev * pdev ,
const struct drm_driver * drv ,
enum ast_chip chip ,
enum ast_config_mode config_mode ,
void __iomem * regs ,
void __iomem * ioregs ,
bool need_post )
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
{
2020-07-30 15:52:00 +02:00
struct drm_device * dev ;
2023-02-21 16:57:44 +01:00
struct ast_device * ast ;
2023-11-16 10:59:29 +01:00
int ret ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2023-02-21 16:57:44 +01:00
ast = devm_drm_dev_alloc ( & pdev - > dev , drv , struct ast_device , base ) ;
2020-07-30 15:52:03 +02:00
if ( IS_ERR ( ast ) )
2023-11-16 10:59:29 +01:00
return ERR_CAST ( ast ) ;
2020-07-30 15:52:03 +02:00
dev = & ast - > base ;
2020-07-30 15:52:00 +02:00
2023-11-16 10:59:28 +01:00
ast - > chip = chip ;
ast - > config_mode = config_mode ;
2023-11-16 10:59:29 +01:00
ast - > regs = regs ;
ast - > ioregs = ioregs ;
2023-11-16 10:59:28 +01:00
2023-06-21 14:53:47 +02:00
ast_detect_widescreen ( ast ) ;
ast_detect_tx_chip ( ast , need_post ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2020-06-17 10:03:37 +02:00
ret = ast_get_dram_info ( dev ) ;
if ( ret )
2020-07-30 15:52:03 +02:00
return ERR_PTR ( ret ) ;
2020-07-16 14:53:51 +02:00
drm_info ( dev , " dram MCLK=%u Mhz type=%d bus_width=%d \n " ,
ast - > mclk , ast - > dram_type , ast - > dram_bus_width ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2020-07-16 14:53:52 +02:00
if ( need_post )
ast_post_gpu ( dev ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
ret = ast_mm_init ( ast ) ;
if ( ret )
2020-07-30 15:52:03 +02:00
return ERR_PTR ( ret ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2021-04-21 16:58:59 +08:00
/* map reserved buffer */
ast - > dp501_fw_buf = NULL ;
2022-10-13 13:29:22 +02:00
if ( ast - > vram_size < pci_resource_len ( pdev , 0 ) ) {
ast - > dp501_fw_buf = pci_iomap_range ( pdev , 0 , ast - > vram_size , 0 ) ;
2021-04-21 16:58:59 +08:00
if ( ! ast - > dp501_fw_buf )
drm_info ( dev , " failed to map reserved buffer! \n " ) ;
}
2020-07-02 13:50:29 +02:00
ret = ast_mode_config_init ( ast ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
if ( ret )
2020-07-30 15:52:03 +02:00
return ERR_PTR ( ret ) ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
2023-11-16 10:59:29 +01:00
return dev ;
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 13:40:04 +00:00
}