Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-24 Thread Adam Ford
On Thu, Mar 24, 2022 at 4:58 AM Heiko Thiery wrote: > > Hi Adam, > > [SNIP] > > > > > I was thinking that we could expand the struct mxc_serial_plat to > > include both per and igp clocks to cover devices have clocks that are > > not the same. The configuring of the platdata can happen using > >

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-24 Thread Heiko Thiery
Hi Adam, [SNIP] > > I was thinking that we could expand the struct mxc_serial_plat to > include both per and igp clocks to cover devices have clocks that are > not the same. The configuring of the platdata can happen using > mxc_serial_of_to_plat to 'get' both igp and per clocks. The probe >

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-23 Thread Adam Ford
On Tue, Mar 22, 2022 at 7:48 AM Angus Ainslie wrote: > > On 2022-03-21 06:50, Heiko Thiery wrote: > > Hi Angus, > > > > [snip] > > > >> > So I'm not sure if the ipg clock is the right one for the boards that > >> > has different clock for ipg and per. > >> > >> So I only looked at imx6qdl.dtsi

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-22 Thread Angus Ainslie
On 2022-03-21 06:50, Heiko Thiery wrote: Hi Angus, [snip] > So I'm not sure if the ipg clock is the right one for the boards that > has different clock for ipg and per. So I only looked at imx6qdl.dtsi where the clocks are different clocks = < IMX6QDL_CLK_UART_IPG>, <

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-21 Thread Heiko Thiery
Hi Angus, [snip] > > So I'm not sure if the ipg clock is the right one for the boards that > > has different clock for ipg and per. > > So I only looked at imx6qdl.dtsi where the clocks are different > > clocks = < IMX6QDL_CLK_UART_IPG>, > < IMX6QDL_CLK_UART_SERIAL>; > clock-names =

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-19 Thread Angus Ainslie
On 2022-03-18 12:06, Heiko Thiery wrote: Hi Angus, Am Do., 17. März 2022 um 14:19 Uhr schrieb Angus Ainslie : Hi Heiko, On 2022-03-17 05:41, Heiko Thiery wrote: > With the clock driver enabled for the imx8mq, it was noticed that the > frequency used to calculate the baud rate is always

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-18 Thread Heiko Thiery
Hi Angus, Am Do., 17. März 2022 um 14:19 Uhr schrieb Angus Ainslie : > > Hi Heiko, > > On 2022-03-17 05:41, Heiko Thiery wrote: > > With the clock driver enabled for the imx8mq, it was noticed that the > > frequency used to calculate the baud rate is always taken from the root > > clock of UART1.

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-18 Thread Sean Anderson
On 3/18/22 4:05 AM, Heiko Thiery wrote: Hi Sean, Am Fr., 18. März 2022 um 03:19 Uhr schrieb Sean Anderson : On 3/17/22 3:14 PM, Heiko Thiery wrote: Hi Sean, Am Do., 17. März 2022 um 15:38 Uhr schrieb Sean Anderson : Hi Heiko, On 3/17/22 8:41 AM, Heiko Thiery wrote: With the clock driver

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-18 Thread Heiko Thiery
Hi Sean, Am Fr., 18. März 2022 um 03:19 Uhr schrieb Sean Anderson : > > On 3/17/22 3:14 PM, Heiko Thiery wrote: > > Hi Sean, > > > > Am Do., 17. März 2022 um 15:38 Uhr schrieb Sean Anderson > > : > >> > >> Hi Heiko, > >> > >> On 3/17/22 8:41 AM, Heiko Thiery wrote: > >>> With the clock driver

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Sean Anderson
On 3/17/22 3:14 PM, Heiko Thiery wrote: Hi Sean, Am Do., 17. März 2022 um 15:38 Uhr schrieb Sean Anderson : Hi Heiko, On 3/17/22 8:41 AM, Heiko Thiery wrote: With the clock driver enabled for the imx8mq, it was noticed that the frequency used to calculate the baud rate is always taken from

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Sean Anderson
On 3/17/22 10:47 AM, Michael Walle wrote: +    struct clk clk; +    if(!clk_get_by_name(dev, "ipg", )) +    rate = clk_get_rate(); +    } + +    /* as fallback we try to get the clk rate that way */ +    if (rate == 0) !rate || IS_ERR_VALUE(rate) This looked so weird I had

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Heiko Thiery
Hi Sean, Am Do., 17. März 2022 um 15:38 Uhr schrieb Sean Anderson : > > Hi Heiko, > > On 3/17/22 8:41 AM, Heiko Thiery wrote: > > With the clock driver enabled for the imx8mq, it was noticed that the > > frequency used to calculate the baud rate is always taken from the root > > clock of UART1.

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Lukasz Majewski
Hi Sean, > Hi Heiko, > > On 3/17/22 8:41 AM, Heiko Thiery wrote: > > With the clock driver enabled for the imx8mq, it was noticed that > > the frequency used to calculate the baud rate is always taken from > > the root clock of UART1. This can cause problems if UART1 is not > > used as console

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Michael Walle
+ struct clk clk; + if(!clk_get_by_name(dev, "ipg", )) + rate = clk_get_rate(); + } + + /* as fallback we try to get the clk rate that way */ + if (rate == 0) !rate || IS_ERR_VALUE(rate) This looked so weird I had to

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Sean Anderson
Hi Heiko, On 3/17/22 8:41 AM, Heiko Thiery wrote: With the clock driver enabled for the imx8mq, it was noticed that the frequency used to calculate the baud rate is always taken from the root clock of UART1. This can cause problems if UART1 is not used as console and the settings are different

Re: [RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Angus Ainslie
Hi Heiko, On 2022-03-17 05:41, Heiko Thiery wrote: With the clock driver enabled for the imx8mq, it was noticed that the frequency used to calculate the baud rate is always taken from the root clock of UART1. This can cause problems if UART1 is not used as console and the settings are different

[RFC] serial: mxc: get the clock frequency from the used clock for the device

2022-03-17 Thread Heiko Thiery
With the clock driver enabled for the imx8mq, it was noticed that the frequency used to calculate the baud rate is always taken from the root clock of UART1. This can cause problems if UART1 is not used as console and the settings are different from UART1. The result is that the console output is