[PATCH v2] drm/amdgpu: fix power distribution issue for Polaris10 XT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of zhoucm1
> Sent: Monday, July 11, 2016 10:43 PM
> To: Wang, Qingqing; amd-gfx at lists.freedesktop.org
> Subject: Re: [PATCH v2] drm/amdgpu: fix power distribution issue for
> Polaris10 XT
> 
> 
> 
> On 2016å¹´07æ??12æ?¥ 10:39, Ken Wang wrote:
> > Change-Id: I8676174acd3273dd8dccc72ecc1d54e9626bdb71
> > Signed-off-by: Ken Wang <Qingqing.Wang at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/atombios_i2c.c | 15 +++++++++++++++
> >   drivers/gpu/drm/amd/amdgpu/atombios_i2c.h |  1 +
> >   drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c     |  5 +++++
> >   3 files changed, 21 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> > index 13cdb01..145d752 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> > @@ -156,3 +156,18 @@ u32 amdgpu_atombios_i2c_func(struct
> i2c_adapter *adap)
> >   	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> >   }
> >
> > +void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev,
> u8 offset, u8 data)
> > +{
> > +	PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args;
> > +	int index = GetIndexIntoMasterTable(COMMAND,
> ProcessI2cChannelTransaction);
> > +
> > +	args.ucRegIndex = offset;
> > +	args.lpI2CDataOut = data;
> > +	args.ucFlag = 1;
> > +	args.ucI2CSpeed = TARGET_HW_I2C_CLOCK;
> > +	args.ucTransBytes = 1;
> > +	args.ucSlaveAddr = 0x10;
> 
> Is this Polaris10 XT specific? if yes, seems the func name need to be
> specific as well.

If that's the case, then just make it a generic i2c write function like I suggested in my other email and pass in the slave_addr and i2c_line.  Then it can be used anywhere as a simple helper.

Alex

> 
> Regards,
> David Zhou
> 
> > +	args.ucLineNumber = 0x96;
> > +
> > +	amdgpu_atom_execute_table(adev->mode_info.atom_context,
> index, (uint32_t *)&args);
> > +}
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h
> b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h
> > index d6128d9d..d31344f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h
> > @@ -27,5 +27,6 @@
> >   int amdgpu_atombios_i2c_xfer(struct i2c_adapter *i2c_adap,
> >   		      struct i2c_msg *msgs, int num);
> >   u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap);
> > +void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev,
> u8 offset, u8 data);
> >
> >   #endif
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > index dbef1ed..362eab7 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > @@ -28,6 +28,7 @@
> >   #include "vid.h"
> >   #include "amdgpu_ucode.h"
> >   #include "amdgpu_atombios.h"
> > +#include "atombios_i2c.h"
> >   #include "clearstate_vi.h"
> >
> >   #include "gmc/gmc_8_2_d.h"
> > @@ -693,6 +694,10 @@ static void gfx_v8_0_init_golden_registers(struct
> amdgpu_device *adev)
> >   		amdgpu_program_register_sequence(adev,
> >
> polaris10_golden_common_all,
> >   						 (const
> u32)ARRAY_SIZE(polaris10_golden_common_all));
> > +		if (adev->pdev->revision == 0xc7) {
> > +			amdgpu_atombios_i2c_channel_trans(adev, 0x1E,
> 0xDD);
> > +			amdgpu_atombios_i2c_channel_trans(adev, 0x1F,
> 0xD0);
> > +		}
> >   		break;
> >   	case CHIP_CARRIZO:
> >   		amdgpu_program_register_sequence(adev,
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux